Commit 4d471ae5 authored by Federico Sismondi's avatar Federico Sismondi
Browse files

small modifs on usage example

parent f15ea225
......@@ -154,7 +154,19 @@ if __name__ == '__main__':
}
))
connection = pika.BlockingConnection(pika.URLParameters(AMQP_URL))
m = MsgSniffingGetCapture()
r = amqp_request(connection, m, 'someImaginaryComponent')
print(repr(r))
retries_left = 3
while retries_left > 0:
try:
connection = pika.BlockingConnection(pika.URLParameters(AMQP_URL))
m = MsgTest()
publish_message(connection, m)
break
except pika.exceptions.ConnectionClosed:
retries_left -= 1
print('retrying..')
time.sleep(0.2)
# r = amqp_request(connection, m, 'someImaginaryComponent')
# print(repr(r))
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