summaryrefslogtreecommitdiff
path: root/qpid/python/hello-010-world
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2008-03-04 20:03:09 +0000
committerRafael H. Schloming <rhs@apache.org>2008-03-04 20:03:09 +0000
commitc19ba3eb15620becdbc157005dcc5a465b3ac064 (patch)
tree7869959c4c2327355e117b87bc9b761d1ad247bc /qpid/python/hello-010-world
parent920ebd038170238ab4e77d25a77cf2c6730ba97b (diff)
downloadqpid-python-c19ba3eb15620becdbc157005dcc5a465b3ac064.tar.gz
import of in-process 0-10 final python client
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@633610 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python/hello-010-world')
-rwxr-xr-xqpid/python/hello-010-world24
1 files changed, 24 insertions, 0 deletions
diff --git a/qpid/python/hello-010-world b/qpid/python/hello-010-world
new file mode 100755
index 0000000000..7685af8fd3
--- /dev/null
+++ b/qpid/python/hello-010-world
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+
+from qpid.connection010 import Connection
+from qpid.spec010 import load
+from qpid.util import connect
+from qpid.datatypes import Message
+
+spec = load("../specs/amqp.0-10.xml")
+conn = Connection(connect("0.0.0.0", spec.port), spec)
+conn.start(timeout=10)
+
+ssn = conn.session("my-session")
+
+ssn.queue_declare("asdf")
+
+ssn.message_transfer("this", None, None, Message("testing..."))
+ssn.message_transfer("is")
+ssn.message_transfer("a")
+ssn.message_transfer("test")
+
+print ssn.queue_query("testing")
+
+ssn.close(timeout=10)
+conn.close(timeout=10)