You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by "usman.ch" <us...@infotechgroup.com> on 2010/06/02 07:24:32 UTC
Blocking request call using request-response_client example
Based on the request/response client and server examples , I want to
modify the client in way that it send a request and wait for the reply
before sending next request. Want to implement blocking mechanism.
subscriptions.run(); blocks for the entire subscription and calling
subscription.stop() in received() method of the listner to resume the main
application results in queue deletion. Could anyone please guide me in this
regard as what function should I call to make client blocking till it
received the response from server.
Regards.
Usman Majeed
--
View this message in context: http://apache-qpid-users.2158936.n2.nabble.com/Blocking-request-call-using-request-response-client-example-tp5129336p5129336.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org
Re: Blocking request call using request-response_client example
Posted by Alan Conway <ac...@redhat.com>.
On 06/02/2010 01:24 AM, usman.ch wrote:
>
> Based on the request/response client and server examples , I want to
> modify the client in way that it send a request and wait for the reply
> before sending next request. Want to implement blocking mechanism.
> subscriptions.run(); blocks for the entire subscription and calling
> subscription.stop() in received() method of the listner to resume the main
> application results in queue deletion. Could anyone please guide me in this
> regard as what function should I call to make client blocking till it
> received the response from server.
>
If you're using the new messaging API, which is recommended if you're using the
latest version, there is a synchronous request/respose example in
qpid/cpp/examples/messaging/client.cpp.
If you're stuck on the old API you can create a client::LocalQueue and subscribe
that instead of a MessageListener. The LocalQueue has methods for getting
messages one at a time from the queue.
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org