Commit 529d87d9 authored by Jonathan Schaeffer's avatar Jonathan Schaeffer
Browse files

Receiver has to be created only once

parent 3f43ac98
......@@ -199,6 +199,7 @@ if __name__ == "__main__":
# connect to AMQP broker
logger.info("Trying to connect to %s", AMQP_SERVER)
connection = BlockingConnection(AMQP_SERVER)
receiver = connection.create_receiver(queue)
logger.info("Connected to %s : %s", AMQP_SERVER, connection)
stoploop = False
......@@ -210,7 +211,6 @@ if __name__ == "__main__":
"waiting for incoming message on queue %s ~~~~~~~~~~~~ " % queue
)
receiver = connection.create_receiver(queue)
message = receiver.receive(timeout=None)
logger.info("message received : %s" % message)
......
Supports Markdown
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