Thanks, Jim. I neglected to add that we are using the failover URI in
production. The main problem seems to be around surviving debugging. For
instance, I someone is debugging a service, and goes away for a cup of
coffee for a few minutes, they will invariably find that the broker has send
an NMSException. 

The pseudo-code for what we are trying to do is below. Let's assume that the
developer is working on his own laptop, with a locally-installed single
instance of ActiveMQ. 

    // When initially creating a connection, we set the NMS
ExceptionListener handler
    this.TheConnection.ExceptionListener += this.OnConnectionException;

    // This will get called when we get a break in the connection
    public virtual void OnConnectionException(Exception exception)
    {
      if (exception is NMSException)
          this.TryExceptionRepair(exception as NMSException);
    }

    private void TryExceptionRepair(NMSException nmsException)
    {
       // This is where we want to try to re-establish connections,
sessions, etc
    }


Let's say that we have a single Connection, a single Session that is
associated with the connection, and a number of MessageConsumers and
MessageProducers that were created by that Session.

Is there a well-known pattern for re-establishing the environment when the
connection is broker?

Also, any advice regarding the URI is welcome.

Thanks,

Marc



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/ActiveMQ-NMS-and-Failure-Recovery-tp4717704p4717707.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to