diff options
| author | Gordon Sim <gsim@apache.org> | 2007-12-05 16:22:50 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2007-12-05 16:22:50 +0000 |
| commit | 46989a4ce0c90b73dbcb76cb344c95b0de27d360 (patch) | |
| tree | 74763483de2456c88b49c9cd030c149b5950c635 /qpid/python/examples/direct/config_direct_exchange.py | |
| parent | 17ac435eab95ea5c7758b4104efba53b313c7916 (diff) | |
| download | qpid-python-46989a4ce0c90b73dbcb76cb344c95b0de27d360.tar.gz | |
Renamed for consistency with c++
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@601394 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python/examples/direct/config_direct_exchange.py')
| -rw-r--r-- | qpid/python/examples/direct/config_direct_exchange.py | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/qpid/python/examples/direct/config_direct_exchange.py b/qpid/python/examples/direct/config_direct_exchange.py deleted file mode 100644 index e64ad678b8..0000000000 --- a/qpid/python/examples/direct/config_direct_exchange.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python -""" - config_direct_exchange.py - - Creates and binds a queue on an AMQP direct exchange. - - All messages using the routing key "routing_key" are - sent to the queue named "message_queue". -""" - -import qpid -from qpid.client import Client -from qpid.content import Content -from qpid.queue import Empty - -#----- Initialization ----------------------------------- - -# Set parameters for login - -host="127.0.0.1" -port=5672 -amqp_spec="/usr/share/amqp/amqp.0-10-preview.xml" -user="guest" -password="guest" - -# Create a client and log in to it. - -client = Client(host, port, qpid.spec.load(amqp_spec)) -client.start({"LOGIN": user, "PASSWORD": password}) - -session = client.session() -session.session_open() - -#----- Create a queue ------------------------------------- - -# Create a queue named "listener" on channel 1, and bind it -# to the "amq.direct" exchange. -# -# queue_declare() creates an AMQP queue, which is held -# on the broker. Published messages are sent to the AMQP queue, -# from which messages are delivered to consumers. -# -# queue_bind() determines which messages are routed to a queue. -# Route all messages with the routing key "routing_key" to -# the AMQP queue named "message_queue". - -session.queue_declare(queue="message_queue") -session.queue_bind(exchange="amq.direct", queue="message_queue", routing_key="routing_key") - -#----- Cleanup --------------------------------------------- - -session.session_close() - |
