diff options
| author | rumyana neykova <rumi.neykova@gmail.com> | 2012-09-20 19:46:04 +0100 |
|---|---|---|
| committer | rumyana neykova <rumi.neykova@gmail.com> | 2012-09-20 19:46:44 +0100 |
| commit | bf61bd556c75cb95c6c8202bcd46e412f0273ade (patch) | |
| tree | 33517bd67471217b8b2b28fa45df11285fa98591 /examples | |
| parent | 144c3396229a71475e9a033a8a5ceb76a67b7979 (diff) | |
| download | kombu-bf61bd556c75cb95c6c8202bcd46e412f0273ade.tar.gz | |
change unbind to support bindings parameters.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/complete_send.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/complete_send.py b/examples/complete_send.py index 83de890b..c81f8620 100644 --- a/examples/complete_send.py +++ b/examples/complete_send.py @@ -11,11 +11,12 @@ from kombu import Connection, Producer, Exchange, Queue #: By default messages sent to exchanges are persistent (delivery_mode=2), #: and queues and exchanges are durable. -gateway_exchange = Exchange('gateway_kombu_demo', type='direct') +exchange = Exchange('kombu_demo', type='direct') +queue = Queue('kombu_demo', exchange, routing_key='kombu_demo') + + +with Connection('amqp://guest:guest@localhost:5672//') as connection: -with Connection('pyamqp://guest:guest@localhost:5672//') as connection: - #binded = exchange.bind(connection.channel()) - #binded.exchange_bind(gateway_exchange, routing_key = 'kombu_demo') #: Producers are used to publish messages. #: a default exchange and routing key can also be specifed #: as arguments the Producer, but we rather specify this explicitly @@ -26,6 +27,6 @@ with Connection('pyamqp://guest:guest@localhost:5672//') as connection: #: and zlib compression. The kombu consumer will automatically detect #: encoding, serialization and compression used and decode accordingly. producer.publish({'hello': 'world'}, - exchange=gateway_exchange, + exchange=exchange, routing_key='kombu_demo', serializer='json', compression='zlib') |
