On 08/24/2012 09:35 AM, Zhemzhitsky Sergey wrote:
Is it possible to forcibly close a receiver that is currently waits for incoming message with Duration::FOREVER? I.e. Receiver.get(message, Duration::FOREVER)
Sadly, it appears not, short of closing the underlying session. The receiver is blocked on a session level incoming message queue and at present there is no way to signal to a specific receiver blocked on that structure that it has been closed.
The other workaround is to use a smaller duration and poll a little bit. This shouldn't require any more network traffic, it would just wake the thread up every so often and recheck the state of the receiver.
Call to Receiver.close() from another thread seems does not cancels the receiving in that case.
That seems to be a design flaw (as described above). If you want to raise a JIRA and assign to me I'll see if I can find a way to fix that and will certainly make sure that case works for the new AMQP 1.0 implementation.
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
