Commit 72cf9efd authored by Alexander Lercher's avatar Alexander Lercher

Trace Retrieval: message handling with working json parser

parent fd3515f4
......@@ -81,6 +81,9 @@ class MessageReceiver:
def stop(self):
'''Stops listening for messages and closes the connection'''
self._connection.ioloop.stop()
self._connection.close()
LOGGER.info(f"RabbitMQ connection closed")
\ No newline at end of file
try:
self._connection.ioloop.stop()
self._connection.close()
LOGGER.info("RabbitMQ connection closed")
except pika.exceptions.ConnectionWrongStateError:
LOGGER.warning("RabbitMQ connection already closed")
......@@ -25,7 +25,7 @@ class MessageHandler:
return
if message['type'] == 'blockchain-transaction':
self.handle_blockchain_transaction(json.loads(message['content']))
self.handle_blockchain_transaction(message['content'])
def handle_blockchain_transaction(self, transaction):
self._mongo_repo.insert_trace(transaction)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment