Reconnection for asynchronous consumer
Hello,
I have a connection with only an asynchronous consumer and a JMS ExceptionListener on it. When I pull out the network cable on the client for 10 minutes or so (long enough for the server to close the connection), then plug it back in, my consumer never receives a message again. There is no exception received by the listener. It doesn't seem to matter if my reconnect settings are infinite or not.
If I put producers on the connection, the connection is re-established (or the JMSExceptionListener receives an exception) and everything is fine.
I need to be able to detect the fact that there is a problem. Should I be making synchronous receive calls instead? What about a dummy producer on the connection?
Thanks,
Aaron
[775 byte] By [
aeddydev] at [2007-11-25 17:26:05]

# 1
Aron,
I guess, you are facing here 'half open connection' problem.
There is already bug filed regarding this and the fix will be available within MQ3.6 timeline.
Bug description is,
"We're doing some reliability/stress testing that involves periodically disabling/re-enabling network interfaces. Every once in a while we end up with a half open connection between the MQ client and broker--the client thinks the connection is up, but the broker has closed it. The client detects that the connection is down when it tries to publish, but if it's only a subscriber, then
it never knows the connection went away. The broker has a mechanism that pings the client-side periodically to prevent this situation, but there doesn't appear to a similar mechanism on the client side.
Ideally, the client's ExceptionListener.onException method should be called when the connection is detected to be (half-)closed."
Workaround suggested is,
" To generate traffic between the client and the broker by creating a session and closing it or creating a temporary destination and deleting it. This will trigger the Exception."
Hope this helps.
Thanks.
--
Sagar
http://wwws.sun.com/software/products/message_queue