Hello, I have a java application which recieve messages from a queue. Everything is working fine but onException is not being called properly.
I am using activemq-5.3.2 and for application jdk1.6 In my code, i am using the connector uri:- failover:(tcp://hostname:61630) Implemented exceptionListener and in onException ,written rerty connection code. ActiveMQ is on remote server and i am running application from my local I was trying to see the behavious of my application when ActiveMQ is not available or down. I tried the follwoing three scenarios:- 1. Disconnect network and started application, it started retrying as per code logic. [Pass] 2. Started application and it connected to ActiveMQ successfully. It consumed messages also. Now disconnected network, it works fine, it was trying to reconnect and connected when network is available[Pass] In logs, i can see message "WARN FailoverTransport.java -handleTransportFailure():226 - Transport (host/host:61630) failed to tcp://host:61630 , attempting to automatically reconnect due to: java.net.SocketException: Connection reset 16 Apr 2011 23:04:17 INFO FailoverTransport.java -doReconnect():878 - Successfully reconnected to tcp://host:61630" 3. Started application , it connected to ActiveMQ successfully. Now disconnected network, application stops immediately. [Fail] Only entry in logs:- "WARN FailoverTransport.java -handleTransportFailure():226 - Transport (host/host:61630) failed to tcp://host:61630 , attempting to automatically reconnect due to: java.net.SocketException: Connection reset" But application stops immediately. In any test case onException method is not being called. In 2nd and 3rd case the only difference is, in 2nd test case onMessage was called before Network failed but in 3rd test case, onMEssage was not called before network failed. I need help to understand the behaviour of ActiveMQ onException uses. Can someone please help me to resolve the 3rd issue. Thanks in advance for any help. Thanks Archana -- View this message in context: http://activemq.2283324.n4.nabble.com/OnException-is-not-being-called-properly-tp3454427p3454427.html Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
