activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From archana saini <>
Subject OnException is not being called properly
Date Sat, 16 Apr 2011 18:55:22 GMT

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

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
-handleTransportFailure():226 - Transport (host/host:61630) failed to
tcp://host:61630 , attempting to automatically reconnect due to: Connection reset
16 Apr 2011 23:04:17 INFO -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
-handleTransportFailure():226 - Transport (host/host:61630) failed to
tcp://host:61630 , attempting to automatically reconnect due to: 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.


View this message in context:
Sent from the ActiveMQ - Dev mailing list archive at

View raw message