summaryrefslogtreecommitdiff
path: root/qpid/python/hello-010-world
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2008-03-05 14:39:40 +0000
committerRafael H. Schloming <rhs@apache.org>2008-03-05 14:39:40 +0000
commite8966c3c7752bfeb7eb37573c641fe7d10bdd38e (patch)
tree386f438767571c173c679fa80bb4e180f8bf9e5d /qpid/python/hello-010-world
parentbcc71fc695435b1a26392325c216bec845831b48 (diff)
downloadqpid-python-e8966c3c7752bfeb7eb37573c641fe7d10bdd38e.tar.gz
added incoming queues for messages; altered session dispatch to send entire assembly to a single handler; added logging switch for hello-010-world
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@633861 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python/hello-010-world')
-rwxr-xr-xqpid/python/hello-010-world16
1 files changed, 13 insertions, 3 deletions
diff --git a/qpid/python/hello-010-world b/qpid/python/hello-010-world
index 1b4c9aed33..2b762b1296 100755
--- a/qpid/python/hello-010-world
+++ b/qpid/python/hello-010-world
@@ -1,13 +1,18 @@
#!/usr/bin/env python
-import logging
+import sys, logging
from qpid.connection010 import Connection
from qpid.spec010 import load
from qpid.util import connect
from qpid.datatypes import Message
+if "-v" in sys.argv:
+ level = logging.DEBUG
+else:
+ level = logging.WARN
+
format = "%(asctime)s %(name)-12s %(levelname)-8s %(message)s"
-logging.basicConfig(level=logging.DEBUG, format=format, datefmt='%H:%M:%S')
+logging.basicConfig(level=level, format=format, datefmt='%H:%M:%S')
spec = load("../specs/amqp.0-10.xml")
conn = Connection(connect("0.0.0.0", spec.port), spec)
@@ -18,10 +23,15 @@ ssn = conn.session("my-session", timeout=10)
ssn.queue_declare("asdf")
ssn.message_transfer("this", None, None, Message("testing..."))
-ssn.message_transfer("is")
+ssn.message_transfer("is", None, None, Message("more testing..."))
ssn.message_transfer("a")
ssn.message_transfer("test")
+print ssn.incoming("this").get()
+print ssn.incoming("is").get()
+print ssn.incoming("a").get()
+print ssn.incoming("test").get()
+
print ssn.queue_query("testing")
ssn.close(timeout=10)