mirror of https://github.com/celery/kombu.git
10 lines
325 B
Python
10 lines
325 B
Python
|
from __future__ import with_statement
|
||
|
from kombu import Connection
|
||
|
|
||
|
with Connection('amqp://guest:guest@localhost:5672//') as conn:
|
||
|
simple_queue = conn.SimpleQueue('simple_queue')
|
||
|
message = simple_queue.get(block=True, timeout=1)
|
||
|
print("Received: %s" % message.payload)
|
||
|
message.ack()
|
||
|
simple_queue.close()
|