Hi Kai,

I agree with what you say - but the original reason we passed exceptions is that some developers required to know if there was a problem by this mechanism. ActiveMQ users in general don't try to reconnect on a Connection.onException() - because they typically use a fault tolerant failover connection (now the default transport).

Its to support these users I'm suggesting that we add a supplementary method to call an exception - and use Connection.onException() for its proper purpose :) If you don't register an exception listener on this new method - it won't know anything about it - the exception will just get logged - which handles your case as well

cheers,

Rob

On 30 May 2008, at 12:11, khudalla wrote:


Rob,

thanks for your explanations. However, even if we had such an additional listener for this kind of exception, what would such a listener be supposed to do about it? The problem remains the same, i.e. we still do not know, how to handle the problem properly since it can have arbitrary reasons. In this particular case however, I don't see how "panicking" (i.e. re- connecting to the broker) would be of any help. Since the exception listener registered on
the connection is the one registered by the RA (and the
ActiveMQSession.run() method can be sure of that since the run() method is used by the RA only), I think we could just log the error and then silently ignore the exception, don't you think? In other cases (i.e. in the rest of
the client code) the onAsyncException() strategy may be appropriate,
however.

Kai


rajdavies wrote:


Hi Kai,

Thanks for the feedback and good description of the problem! The
problem is that the only mechanism to notify of an internal async
exception is through the Connection Exception listener - and and we
use this for both internal client exceptions - and actual transport
exceptions. However, I agree that this is erroneous - according to the
JMS API - onException() should only be called if there is a serious
problem with the Connection object itself.

We do call this from multiple places in the client side code -
normally to notify that there is a runtime exception from the
container (as in this case) or the application when consuming a
message asynchronously.

I think we need to add an additional method on the Connection for
registering an Exception listener for general client/application
exceptions


cheers,

Rob

http://open.iona.com/products/enterprise-activemq
http://rajdavies.blogspot.com/







--
View this message in context: 
http://www.nabble.com/Handling-of-RuntimeExceptions-in-ActiveMQSession.run%28%29-method-tp17554360s2354p17556456.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Reply via email to