diff options
Diffstat (limited to 'qpid/python/hello-world')
| -rwxr-xr-x | qpid/python/hello-world | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/qpid/python/hello-world b/qpid/python/hello-world index b3170c8e0c..5ba14b0fc1 100755 --- a/qpid/python/hello-world +++ b/qpid/python/hello-world @@ -3,14 +3,25 @@ import qpid from qpid.client import Client from qpid.content import Content -client = Client("127.0.0.1", 5672, qpid.spec.load("../specs/amqp.0-10-preview.xml")) +spec = qpid.spec.load("../specs/amqp.0-10-preview.xml") +client = Client("127.0.0.1", 5672, spec) client.start({"LOGIN": "guest", "PASSWORD": "guest"}) ch = client.channel(1) ch.session_open() ch.queue_declare(queue="test") ch.queue_bind(exchange="amq.direct", queue="test", routing_key="test") -print ch.queue_query(queue="test") -ch.message_subscribe(queue="test", destination="test") +#print ch.queue_query(queue="test") +ch.message_subscribe(queue="test", destination="amq.direct") +ch.message_flow("amq.direct", 0, 0xFFFFFFFF) +ch.message_flow("amq.direct", 1, 0xFFFFFFFF) msg = Content("hello world") msg["content_type"] = "text/plain" +msg["routing_key"] = "test" +msg["reply_to"] = spec.struct("reply_to") +msg["reply_to"].exchange_name = "asdf" +msg["reply_to"].routing_key = "fdsa" +msg["application_headers"] = {"x": 1, "y": 2, "z": "zee"} ch.message_transfer(destination="amq.direct", content=msg) +queue = client.queue("amq.direct") +msg = queue.get(timeout=10) +print msg |
