diff options
author | Ask Solem <ask@celeryproject.org> | 2013-12-11 12:50:40 +0000 |
---|---|---|
committer | Ask Solem <ask@celeryproject.org> | 2013-12-11 12:50:40 +0000 |
commit | 7547c5061085f28ba2cdfc47507f021574b97dff (patch) | |
tree | e9d8435096b6e7a29948ae744ef583e5ab4747b7 /examples | |
parent | cbc6001330b6d4cb6b2c03490dd29ff482ab57c8 (diff) | |
download | kombu-7547c5061085f28ba2cdfc47507f021574b97dff.tar.gz |
Example should not use exchange bindings. Closes #286
Diffstat (limited to 'examples')
-rw-r--r-- | examples/complete_receive.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/examples/complete_receive.py b/examples/complete_receive.py index 373b74c1..30d4d461 100644 --- a/examples/complete_receive.py +++ b/examples/complete_receive.py @@ -7,6 +7,8 @@ from pprint import pformat #: By default messages sent to exchanges are persistent (delivery_mode=2), #: and queues and exchanges are durable. +exchange = Exchange('kombu_demo', type='direct') +queue = Queue('kombu_demo', exchange, routing_key='kombu_demo') def pretty(obj): @@ -24,16 +26,7 @@ def handle_message(body, message): #: If hostname, userid, password and virtual_host is not specified #: the values below are the default, but listed here so it can #: be easily changed. -with Connection('pyamqp://guest:guest@localhost:5672//') as connection: - # The configuration of the message flow is as follows: - # gateway_kombu_exchange -> internal_kombu_exchange -> kombu_demo queue - gateway_exchange = Exchange('gateway_kombu_demo')(connection) - exchange = Exchange('internal_kombu_demo')(connection) - gateway_exchange.declare() - exchange.declare() - exchange.bind_to(gateway_exchange, routing_key='kombu_demo') - - queue = Queue('kombu_demo', exchange, routing_key='kombu_demo') +with Connection('amqp://guest:guest@localhost:5672//') as connection: #: Create consumer using our callback and queue. #: Second argument can also be a list to consume from |