summaryrefslogtreecommitdiff
path: root/qpid/python/examples/pubsub/topic_publisher.py
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-12-05 18:53:36 +0000
committerGordon Sim <gsim@apache.org>2007-12-05 18:53:36 +0000
commit8896a1a5ce01157036cc3096fdb33e8be50d4a02 (patch)
tree269089975423ea5224be61ff42a631ac11782e24 /qpid/python/examples/pubsub/topic_publisher.py
parent54d661119573c75cbf31a4df242c8cf412538afa (diff)
downloadqpid-python-8896a1a5ce01157036cc3096fdb33e8be50d4a02.tar.gz
Reversed renaming
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@601467 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python/examples/pubsub/topic_publisher.py')
-rw-r--r--qpid/python/examples/pubsub/topic_publisher.py96
1 files changed, 0 insertions, 96 deletions
diff --git a/qpid/python/examples/pubsub/topic_publisher.py b/qpid/python/examples/pubsub/topic_publisher.py
deleted file mode 100644
index c3b13cd82c..0000000000
--- a/qpid/python/examples/pubsub/topic_publisher.py
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/usr/bin/env python
-"""
- topic_producer.py
-
- This is a simple AMQP publisher application that uses a
- Topic exchange. The publisher specifies the routing key
- and the exchange for each message.
-"""
-
-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.
-
-spec = qpid.spec.load(amqp_spec)
-client = Client(host, port, spec)
-client.start({"LOGIN": user, "PASSWORD": password})
-
-session = client.session()
-session.session_open()
-
-#----- Publish some messages ------------------------------
-
-# Create some messages and put them on the broker. Use the
-# topic exchange. The routing keys are "usa.news", "usa.weather",
-# "europe.news", and "europe.weather".
-
-final = "That's all, folks!"
-
-# We'll use the same routing key for all messages in the loop, and
-# also for the terminating message.
-
-# usa.news
-
-for i in range(5):
- message = Content("message " + str(i))
- message["routing_key"] = "usa.news"
- session.message_transfer(destination="amq.topic", content=message)
-
-message = Content(final)
-message["routing_key"] = "usa.news"
-session.message_transfer(destination="amq.topic", content=message)
-
-# usa.weather
-
-
-for i in range(5):
- message = Content("message " + str(i))
- message["routing_key"] = "usa.weather"
- session.message_transfer(destination="amq.topic", content=message)
-
-message = Content(final)
-message["routing_key"] = "usa.weather"
-session.message_transfer(destination="amq.topic", content=message)
-
-# europe.news
-
-for i in range(5):
- message = Content("message " + str(i))
- message["routing_key"] = "europe.news"
- session.message_transfer(destination="amq.topic", content=message)
-
-message = Content(final)
-message["routing_key"] = "europe.news"
-session.message_transfer(destination="amq.topic", content=message)
-
-
-# europe.weather
-
-for i in range(5):
- message = Content("message " + str(i))
- message["routing_key"] = "europe.weather"
- session.message_transfer(destination="amq.topic", content=message)
-
-message = Content(final)
-message["routing_key"] = "europe.weather"
-session.message_transfer(destination="amq.topic", content=message)
-
-
-#----- Cleanup --------------------------------------------
-
-# Clean up before exiting so there are no open threads.
-
-session.session_close()