There is a transport listener interface that can give you indications
of reconnects.
see: org.apache.activemq.ActiveMQConnection#addTransportListener

For a unit test, have a look at:
org.apache.activemq.usecases.BrokerQueueNetworkWithDisconnectTest

this uses a socket proxy to simulate a network failure between
networked brokers.

A simple network test with durable subs is:
org.apache.activemq.network.SimpleNetworkTest#testDurableStoreAndForward
you may need a combination of the two.


On 30 June 2011 15:09, Andreas Calvo <flipy....@gmail.com> wrote:
> Sorry for the late response.
>
> There is already a Jira issue
> (https://issues.apache.org/jira/browse/AMQ-3353).
> While I do know how to reproduce it using multicast brokers and producer and
> consumer from the example directory, I do not know how to make a junit case.
> If it's not difficult, I could try to do it.
>
> In the meantime, how can I capture when a client receives a disconnect from
> the broker and restarts the connection?
> I'm trying with advisory messages or execeptions in an embedded broker,
> without succeed.
> Any example of code that I could look at?
>
> thanks
>
> --
> View this message in context: 
> http://activemq.2283324.n4.nabble.com/Durable-subscriptions-not-surviving-network-disconnect-tp3586149p3635766.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
http://fusesource.com
http://blog.garytully.com

Reply via email to