summaryrefslogtreecommitdiff
path: root/python/examples/fanout/declare_queues.py
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-02-15 21:00:44 +0000
committerAlan Conway <aconway@apache.org>2008-02-15 21:00:44 +0000
commita8c96aae65caa95f790fb8f7011731cf5d29454a (patch)
tree2d9427eb7cf5556a57c08d7ceca47feb0a5b5d21 /python/examples/fanout/declare_queues.py
parent2895d73ed993c4f9d9e32116bf7c2ea0d3d089e8 (diff)
downloadqpid-python-a8c96aae65caa95f790fb8f7011731cf5d29454a.tar.gz
Updated c++ and python fanout examples and verify scripts.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@628169 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/examples/fanout/declare_queues.py')
-rwxr-xr-xpython/examples/fanout/declare_queues.py52
1 files changed, 0 insertions, 52 deletions
diff --git a/python/examples/fanout/declare_queues.py b/python/examples/fanout/declare_queues.py
deleted file mode 100755
index 52f23f4f9a..0000000000
--- a/python/examples/fanout/declare_queues.py
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env python
-"""
- declare_queues.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
-import sys
-from qpid.client import Client
-from qpid.content import Content
-from qpid.queue import Empty
-
-#----- Initialization -----------------------------------
-
-# Set parameters for login
-
-host=len(sys.argv) > 1 and sys.argv[1] or "127.0.0.1"
-port=len(sys.argv) > 2 and int(sys.argv[2]) or 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 -------------------------------------
-
-# 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.fanout", queue="message_queue")
-
-#----- Cleanup ---------------------------------------------
-
-# Clean up before exiting so there are no open threads.
-
-session.session_close()