summaryrefslogtreecommitdiff
path: root/qpid/python/examples/request-response
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/python/examples/request-response')
-rwxr-xr-x[-rw-r--r--]qpid/python/examples/request-response/client.py5
-rwxr-xr-x[-rw-r--r--]qpid/python/examples/request-response/server.py6
-rw-r--r--qpid/python/examples/request-response/verify5
-rw-r--r--qpid/python/examples/request-response/verify.in14
4 files changed, 26 insertions, 4 deletions
diff --git a/qpid/python/examples/request-response/client.py b/qpid/python/examples/request-response/client.py
index e218acce3d..6561bb6fee 100644..100755
--- a/qpid/python/examples/request-response/client.py
+++ b/qpid/python/examples/request-response/client.py
@@ -9,6 +9,7 @@
import base64
import qpid
+import sys
from qpid.client import Client
from qpid.content import Content
from qpid.queue import Empty
@@ -59,8 +60,8 @@ def dump_queue(client, queue_name):
# Set parameters for login
-host="127.0.0.1"
-port=5672
+host=len(sys.argv) > 1 and sys.argv[1] or "127.0.0.1"
+port=len(sys.argv) > 2 and int(sys.argv[2]) or 5672
amqp_spec="/usr/share/amqp/amqp.0-10-preview.xml"
user="guest"
password="guest"
diff --git a/qpid/python/examples/request-response/server.py b/qpid/python/examples/request-response/server.py
index 2730768a91..04b147d003 100644..100755
--- a/qpid/python/examples/request-response/server.py
+++ b/qpid/python/examples/request-response/server.py
@@ -6,6 +6,7 @@
"""
import qpid
+import sys
from qpid.client import Client
from qpid.content import Content
from qpid.queue import Empty
@@ -27,8 +28,8 @@ def respond(session, request):
# Set parameters for login
-host="127.0.0.1"
-port=5672
+host=len(sys.argv) > 1 and sys.argv[1] or "127.0.0.1"
+port=len(sys.argv) > 2 and int(sys.argv[2]) or 5672
amqp_spec="/usr/share/amqp/amqp.0-10-preview.xml"
user="guest"
password="guest"
@@ -61,6 +62,7 @@ session.message_flow(dest, 1, 0xFFFFFFFF)
print "Request server running - run your client now."
print "(Times out after 100 seconds ...)"
+sys.stdout.flush()
# Respond to each request
diff --git a/qpid/python/examples/request-response/verify b/qpid/python/examples/request-response/verify
new file mode 100644
index 0000000000..2a2d479077
--- /dev/null
+++ b/qpid/python/examples/request-response/verify
@@ -0,0 +1,5 @@
+# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
+background "Request server running" ./server.py
+clients ./client.py
+kill %% # Must kill the server.
+outputs "./client.py.out | remove_uuid64" " server.py.out | remove_uuid64"
diff --git a/qpid/python/examples/request-response/verify.in b/qpid/python/examples/request-response/verify.in
new file mode 100644
index 0000000000..c02a423bcb
--- /dev/null
+++ b/qpid/python/examples/request-response/verify.in
@@ -0,0 +1,14 @@
+==== ./client.py.out | remove_uuid64
+Request: Twas brilling, and the slithy toves
+Request: Did gyre and gimble in the wabe.
+Request: All mimsy were the borogroves,
+Request: And the mome raths outgrabe.
+Messages queue: ReplyTo:
+Response: TWAS BRILLING, AND THE SLITHY TOVES
+Response: DID GYRE AND GIMBLE IN THE WABE.
+Response: ALL MIMSY WERE THE BOROGROVES,
+Response: AND THE MOME RATHS OUTGRABE.
+No more messages!
+==== server.py.out | remove_uuid64
+Request server running - run your client now.
+(Times out after 100 seconds ...)