On 09/13/2016 10:21 AM, Andrzej K wrote:
Hi Everyone,
I have a problem with CMS Client, and I am not able to figure out from the
documentation what state the connection and session objects are left in
after I got an exception from MessageConsumer::receive().
I have an open connection and a session. I call MessageConsumer::receive()
on my consumer, and an exception is thrown. When I catch it, does it mean
that my connection and session are still in tact? Or am I expected to reset
Them? Or does it depend on the exception? the documentation seems to be
missing this important aspect.
Regards,
&rzej;
--
View this message in context:
http://activemq.2283324.n4.nabble.com/Do-I-need-to-reconnect-upon-exception-from-receive-tp4716471.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Depends a bit on the exception, there is a TransportListener that you
can hook into on the Connection object that will alert you to connection
disruption. Usually if the receive call fails it is due to transport
failure but there are cases where the connection might still be up. The
failover transport can be used to automatically reconnect in the case of
connection failure so you don't need to manage that.
--
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/