2016-04-06 20:14:05 +00:00
|
|
|
from __future__ import absolute_import, unicode_literals, print_function
|
|
|
|
|
2012-12-11 04:35:02 +00:00
|
|
|
from kombu import Connection
|
|
|
|
|
2016-04-06 20:14:05 +00:00
|
|
|
|
2012-12-11 04:35:02 +00:00
|
|
|
with Connection('amqp://guest:guest@localhost:5672//') as conn:
|
|
|
|
simple_queue = conn.SimpleQueue('simple_queue')
|
|
|
|
message = simple_queue.get(block=True, timeout=1)
|
2016-04-06 20:14:05 +00:00
|
|
|
print('Received: {0}'.format(message.payload))
|
2012-12-11 04:35:02 +00:00
|
|
|
message.ack()
|
|
|
|
simple_queue.close()
|