Oct 24th, 2008, 09:39 AM
DMLC refresh connection issue
I am using jms DefaultMessageListenerContainer.We would like to do exception handling especially when the jms server is down.
In order to do that I overrided refreshConnectionUntilSucessful() method.
After pre-defined attempts connecting back to server we want to notify the admin.
Every thing is good so far. But during testing, i purposely shutdown the jms server while my application is still running and the container is listening to the jms server. So, the DefaultMessageListenerContainer will invoke the refreshConnectionUntilSuccessful() method and keep trying to refresh the connection. Once i started the jms server, i expected that my DefaultListenerContainer is able to consume the message again from the jms server. But the actual fact is it NOT.
I dont understand this issue, am I missing any setting in container? or in client?
Any help is greatly appreciated.
Oct 24th, 2008, 12:00 PM
I Got the problem, At the Client side connection was closed and it was throwing
rg.springframework.jms.IllegalStateException: Connection is closed; nested exception is javax.jms.IllegalStateException: Connection is closed
at org.springframework.jms.support.JmsUtils.convertJm sAccessException(JmsUtils.java:255)
I use SingleConnectionFactory , looks like connection is closed .I changed not use SingleConnectionFactory then it works like charm.
I want to use singleconnectionfactory for sure because it uses only one connection. I saw a resetConnection method there, how is works?
do I need to call manually?
Here is my config
how do i call reset connection? or is there any alternative
Oct 24th, 2008, 12:44 PM
Never mind..I was using the SingleConnectionFactory at the client
it needs to set reconnectOnException to true inorder to reconnect again