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:[email protected]

Reply via email to