diff options
author | Rafael H. Schloming <rhs@apache.org> | 2008-06-11 21:31:12 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2008-06-11 21:31:12 +0000 |
commit | 2becbf6ae901b1c7aecebe95087fd308fc611627 (patch) | |
tree | e3d3cef115a248b2d6ccfe84e69ee348a12e9702 | |
parent | 38ac6f27ea2cb49b0161202e13f222875e5e2b44 (diff) | |
download | qpid-python-2becbf6ae901b1c7aecebe95087fd308fc611627.tar.gz |
replaced example usages of message_flow with the start() method
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@666850 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-x | qpid/python/examples/direct/direct_consumer.py | 5 | ||||
-rwxr-xr-x | qpid/python/examples/direct/listener.py | 3 | ||||
-rwxr-xr-x | qpid/python/examples/fanout/fanout_consumer.py | 5 | ||||
-rwxr-xr-x | qpid/python/examples/fanout/listener.py | 5 | ||||
-rwxr-xr-x | qpid/python/examples/pubsub/topic_subscriber.py | 3 | ||||
-rwxr-xr-x | qpid/python/examples/request-response/client.py | 3 | ||||
-rwxr-xr-x | qpid/python/examples/request-response/server.py | 6 | ||||
-rwxr-xr-x | qpid/python/examples/xml-exchange/listener.py | 5 | ||||
-rwxr-xr-x | qpid/python/examples/xml-exchange/xml_consumer.py | 5 |
9 files changed, 15 insertions, 25 deletions
diff --git a/qpid/python/examples/direct/direct_consumer.py b/qpid/python/examples/direct/direct_consumer.py index e421a417c1..23577e9f53 100755 --- a/qpid/python/examples/direct/direct_consumer.py +++ b/qpid/python/examples/direct/direct_consumer.py @@ -51,11 +51,10 @@ queue = session.incoming(local_queue_name) # Call message_subscribe() to tell the broker to deliver messages # from the AMQP queue to this local client queue. The broker will # start delivering messages as soon as credit is allocated using -# session.message_flow(). +# queue.start(). session.message_subscribe(queue="message_queue", destination=local_queue_name) -session.message_flow(local_queue_name, session.credit_unit.message, 0xFFFFFFFF) -session.message_flow(local_queue_name, session.credit_unit.byte, 0xFFFFFFFF) +queue.start() # Initialize 'final' and 'content', variables used to identify the last message. diff --git a/qpid/python/examples/direct/listener.py b/qpid/python/examples/direct/listener.py index 0716adecef..66927eca4b 100755 --- a/qpid/python/examples/direct/listener.py +++ b/qpid/python/examples/direct/listener.py @@ -74,8 +74,7 @@ queue = session.incoming(local_queue_name) # start delivering messages as soon as message_subscribe() is called. session.message_subscribe(queue="message_queue", destination=local_queue_name) -session.message_flow(local_queue_name, session.credit_unit.message, 0xFFFFFFFF) -session.message_flow(local_queue_name, session.credit_unit.byte, 0xFFFFFFFF) +queue.start() receiver = Receiver() queue.listen (receiver.Handler) diff --git a/qpid/python/examples/fanout/fanout_consumer.py b/qpid/python/examples/fanout/fanout_consumer.py index 4a0e8ef488..a2b1b30141 100755 --- a/qpid/python/examples/fanout/fanout_consumer.py +++ b/qpid/python/examples/fanout/fanout_consumer.py @@ -51,12 +51,11 @@ session.exchange_bind(queue=server_queue_name, exchange="amq.fanout") local_queue_name = "local_queue" local_queue = session.incoming(local_queue_name) -# Call message_consume() to tell the server to deliver messages +# Call message_subscribe() to tell the server to deliver messages # from the AMQP queue to this local client queue. session.message_subscribe(queue=server_queue_name, destination=local_queue_name) -session.message_flow(local_queue_name, session.credit_unit.message, 0xFFFFFFFF) -session.message_flow(local_queue_name, session.credit_unit.byte, 0xFFFFFFFF) +local_queue.start() print "Subscribed to queue " + server_queue_name sys.stdout.flush() diff --git a/qpid/python/examples/fanout/listener.py b/qpid/python/examples/fanout/listener.py index b2ed85045b..74ae858127 100755 --- a/qpid/python/examples/fanout/listener.py +++ b/qpid/python/examples/fanout/listener.py @@ -79,11 +79,10 @@ local_queue = session.incoming(local_queue_name) # Call message_subscribe() to tell the broker to deliver messages # from the AMQP queue to this local client queue. The broker will -# start delivering messages as soon as message_subscribe() is called. +# start delivering messages as soon as local_queue.start() is called. session.message_subscribe(queue=server_queue_name, destination=local_queue_name) -session.message_flow(local_queue_name, session.credit_unit.message, 0xFFFFFFFF) -session.message_flow(local_queue_name, session.credit_unit.byte, 0xFFFFFFFF) +local_queue.start() receiver = Receiver () local_queue.listen (receiver.Handler) diff --git a/qpid/python/examples/pubsub/topic_subscriber.py b/qpid/python/examples/pubsub/topic_subscriber.py index 4ba8e6a680..039cc0c55b 100755 --- a/qpid/python/examples/pubsub/topic_subscriber.py +++ b/qpid/python/examples/pubsub/topic_subscriber.py @@ -41,8 +41,7 @@ def subscribe_queue(server_queue_name, local_queue_name): queue = session.incoming(local_queue_name) session.message_subscribe(queue=server_queue_name, destination=local_queue_name) - session.message_flow(local_queue_name, session.credit_unit.message, 0xFFFFFFFF) - session.message_flow(local_queue_name, session.credit_unit.byte, 0xFFFFFFFF) + queue.start() return queue diff --git a/qpid/python/examples/request-response/client.py b/qpid/python/examples/request-response/client.py index 8d40aca5bb..a9ecd5c78f 100755 --- a/qpid/python/examples/request-response/client.py +++ b/qpid/python/examples/request-response/client.py @@ -81,8 +81,7 @@ queue = session.incoming(local_queue_name) # available. session.message_subscribe(queue=reply_to, destination=local_queue_name) -session.message_flow(local_queue_name, session.credit_unit.message, 0xFFFFFFFF) -session.message_flow(local_queue_name, session.credit_unit.byte, 0xFFFFFFFF) +queue.start() # Send some messages to the server's request queue diff --git a/qpid/python/examples/request-response/server.py b/qpid/python/examples/request-response/server.py index 99b1431509..05ee051c57 100755 --- a/qpid/python/examples/request-response/server.py +++ b/qpid/python/examples/request-response/server.py @@ -60,9 +60,9 @@ session.exchange_bind(exchange="amq.direct", queue="request", binding_key="reque local_queue_name = "local_queue" session.message_subscribe(queue="request", destination=local_queue_name) -session.message_flow(local_queue_name, session.credit_unit.message, 0xFFFFFFFF) -session.message_flow(local_queue_name, session.credit_unit.byte, 0xFFFFFFFF) +queue = session.incoming(local_queue_name) +queue.start() # Remind the user to start the client program @@ -72,8 +72,6 @@ sys.stdout.flush() # Respond to each request -queue = session.incoming(local_queue_name) - # If we get a message, send it back to the user (as indicated in the # ReplyTo property) diff --git a/qpid/python/examples/xml-exchange/listener.py b/qpid/python/examples/xml-exchange/listener.py index db12d57e3e..dec824dddf 100755 --- a/qpid/python/examples/xml-exchange/listener.py +++ b/qpid/python/examples/xml-exchange/listener.py @@ -68,11 +68,10 @@ local_queue = session.incoming(local_queue_name) # Call message_subscribe() to tell the broker to deliver messages # from the AMQP queue to this local client queue. The broker will -# start delivering messages as soon as message_subscribe() is called. +# start delivering messages as soon as local_queue.start() is called. session.message_subscribe(queue="message_queue", destination=local_queue_name) -session.message_flow(local_queue_name, session.credit_unit.message, 0xFFFFFFFF) -session.message_flow(local_queue_name, session.credit_unit.byte, 0xFFFFFFFF) +local_queue.start() receiver = Receiver () local_queue.listen (receiver.Handler) diff --git a/qpid/python/examples/xml-exchange/xml_consumer.py b/qpid/python/examples/xml-exchange/xml_consumer.py index 22973b2bd9..0ab079e7a6 100755 --- a/qpid/python/examples/xml-exchange/xml_consumer.py +++ b/qpid/python/examples/xml-exchange/xml_consumer.py @@ -51,11 +51,10 @@ local_queue = session.incoming(local_queue_name) # Call message_consume() to tell the broker to deliver messages # from the AMQP queue to this local client queue. The broker will -# start delivering messages as soon as message_consume() is called. +# start delivering messages as soon as local_queue.start() is called. session.message_subscribe(queue="message_queue", destination=local_queue_name) -session.message_flow(local_queue_name, session.credit_unit.message, 0xFFFFFFFF) -session.message_flow(local_queue_name, session.credit_unit.byte, 0xFFFFFFFF) +local_queue.start() # Initialize 'final' and 'content', variables used to identify the last message. |