I just checked Thread.interrupt() with the Camel Jms Transport as I am
currently writing a test for another problem.
The blocking thread waits in an Object.wait() in the ActiveMQ jms
transport. So the interrupt command works and the blocking thread
returns with an UnexpectedJmsException from the spring framework. This
means the cancel operation basically works. I think the exception could
be nicer though. Some runtime exception with the same meaning as
InterruptedException would be ideal.
I will also do the test with CXF jms transport and cxf http transport to
see how we handle this in CXF.
Best Regards
Christian
Am 03.10.2010 22:04, schrieb Sergey Beryozkin:
Hi - as far as I recall an IO-blocked thread can only be interrupted by
closing a socket or due to a timeout but it was a long tome ago when I wrote
such a code so I may be wrong, may be it is not the case anymore :-)
cheers, Sergey
On Fri, Oct 1, 2010 at 9:32 PM, Christian Schneider<[email protected]
wrote:
If I know the thread and call interrupt() then the thread should receive
an InterruptedException. I think we should be able to handle this exception
and cancel the call.
I have looked into the jms transport to see how it handles the wait for the
response. In this case MessageConsumer.receive is called. I will check how
it reacts on an interrupt call.
Perhaps it already works like expected.
Regards
Christian
Am 01.10.2010 17:23, schrieb Sergey Beryozkin:
Yes, I agree, that would a really nice feature. But I'm not sure how an
association
between a given calling and blocked thread and the socket dealing with
that
call can be achieved.
May be I'm over-complicating things, but if we start then we'll see :-)
cheers, Sergey
--
----
http://www.liquid-reality.de
--
----
http://www.liquid-reality.de