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__': ...@@ -154,7 +154,19 @@ if __name__ == '__main__':
} }
)) ))
connection = pika.BlockingConnection(pika.URLParameters(AMQP_URL)) retries_left = 3
m = MsgSniffingGetCapture() while retries_left > 0:
r = amqp_request(connection, m, 'someImaginaryComponent') try:
print(repr(r)) 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