Hi Phil,
I understand I have to call the QPID concrete implementation of the JMS
Connection, rather than the Connection interface itself which does not offer
this functionality.
To recap, I need to be handle the following connection events:
1) First connection is established successfully. I can't see a specific
listener method called in this case. Should I assume the connection is
established after I have called the Connection's start()?
2) Connection broken. I think I am notified on ConnectionListener's
preFailover() method when this occurs, right?
3) Connection re-established. Should be the ConnectionListener's
failoverComplete() method as you suggested, right?
Thanks
Marco
Phil Harvey-2 wrote
> Hi Marco,
>
> Try this:
>
> ((AMQConnection)yourJmsConnection).setConnectionListener(
> new org.apache.qpid.jms.ConnectionListener() {
> ...
> public void failoverComplete() {
> ...
> }
> ...
> }
>
> Phil
>
>
>
> On 24 July 2013 09:26, pela <
> mpela.gatti@
> > wrote:
>
>> Hi,
>>
>> I'm building a client with JMS API and want to achieve automatic
>> reconnection mechanism, that is when the connection to the broker is lost
>> the client should reconnect automatically, resubscribe queues, etc.
>>
>> I've added failover=roundrobin to my connection URL and that seems to
>> work
>> even though there is only one broker in the brokerlist (it iterates over
>> that single broker). On the other hand, the application code is not
>> informed
>> at all of the disconnection/reconnection events, because it's all done
>> under
>> the hood by the API.
>>
>> Is it possible some way to get some automatic reconnection mechanism, and
>> at
>> the same time know when the connection is broken (to inform the end user
>> of
>> the temporary disfunction of the system), and when the the connection is
>> re-established (to inform the end user the system has come back to
>> operation)?
>>
>> Thanks in advance for any advice.
>>
>> Regards
>> Marco
>>
>>
>>
>> --
>> View this message in context:
>> http://qpid.2158936.n2.nabble.com/JMS-API-failover-tp7595846.html
>> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
> [email protected]
>> For additional commands, e-mail:
> [email protected]
>>
>>
--
View this message in context:
http://qpid.2158936.n2.nabble.com/JMS-API-failover-tp7595846p7595850.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]