diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2008-03-05 14:39:40 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2008-03-05 14:39:40 +0000 |
| commit | 86779be122dea590bc1e5201c58777ea3e362a95 (patch) | |
| tree | 5867b18efe04c62c99e1ca14d177b0eda894bd82 /python/hello-010-world | |
| parent | 00f2ca6cf33f77e44b94db2701830f8c9bcd794e (diff) | |
| download | qpid-python-86779be122dea590bc1e5201c58777ea3e362a95.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/qpid@633861 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/hello-010-world')
| -rwxr-xr-x | python/hello-010-world | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/python/hello-010-world b/python/hello-010-world index 1b4c9aed33..2b762b1296 100755 --- a/python/hello-010-world +++ b/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) |
