summaryrefslogtreecommitdiff
path: root/examples/hello_consumer.py
blob: e633e02d4121e3037f8c64c4ee6bcf55958e6ae6 (plain)
1
2
3
4
5
6
7
8
9
from kombu import Connection  # noqa


with Connection('amqp://guest:guest@localhost:5672//') as conn:
    simple_queue = conn.SimpleQueue('simple_queue')
    message = simple_queue.get(block=True, timeout=1)
    print(f'Received: {message.payload}')
    message.ack()
    simple_queue.close()