Nithesh Shetty wrote:
hi,
the listener sample has the following settings;
 SubscriptionManager subscriptions(session);
 SubscriptionSettings settings;
 settings.acceptMode = ACCEPT_MODE_EXP;
 settings.acquireMode = ACQUIRE_MODE_PRE_ACQUIRED;
 LocalQueue local_queue;
 subscriptions.subscribe(local_queue, "RMS", settings, "rmsset");
  Message message = local_queue.get();

before getting the message i put a breakpoint over here and i execute another exe to get the message(timeout infinity) but it hangs till the above code gets the message and closes the connection.

Thats because the message has been acquired by the client that you have stopped.

Note also that with the local queue, the auto-acking behaviour is to accept the message before returning it. So after the get() above, the message will have been dequeued. If you don't want this you need to turn off auto-acking (e.g. settings.autoAck = 0) and handle issuing the accept yourself.

Further, as you are not using any flow control, the first client will likely have several other acquired (but unaccepted) messages in the local queue. If you want to avoid that set some flow control (e.g. settings.flowControl = FlowControl::messageWindow(1)).


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to