1 Reply Latest reply on Sep 7, 2011 6:09 AM by garytully

    Detect state of connection when using failover transport

    kriswhite

      Hi everyone,

       

      Is there an easy (or difficult!) way to detect whether you are connected to a broker when using the failover transport?

       

      Kris

        • 1. Re: Detect state of connection when using failover transport
          garytully

          Register a org.apache.activemq.transport.TransportListener via org.apache.activemq.ActiveMQConnection#addTransportListener and track the state between calls to transportInterupted() and transportResumed()

          or

          narrow your ActiveMQConnection generic transport to a FailoverTransport and check the status directly, pseudo code:

          activeMqConnection.getTransportChannel().narrow(FailoverTransport.class).isConnected()