It seems like you reinvented the wheel a little bit there, but I'm glad you
got it to work for you.
On Wed, Oct 12, 2016, 8:36 AM magmasystems <mad...@quantifisolutions.com>
> Thanks Jim and Tim. I managed to hook up a poor-man's recover mechanism.
> application uses a framework that sits over the various low-level messaging
> APIs, such ActiveMQ NMS, Tibco EMS .NET client, and the .NET RabbitMQ
> client. So we actually have thin "proxy objects" sitting on top of the
> native MessageConsumers and MessageProducers. When we detect a broker
> failure, we instantiate a new connection and new sessions, and we recreate
> the MessageConsumers and MessageProducers that the application was using.
> Not the most elegant solution, but it was accomplished in a few lines of
> code and seems to work.
> The most difficult thing to do (which is not too difficult, and only
> involved finding the correct combination of BindingFlags to use) is to copy
> the listener from the old MessageConsumer to the new MessageConsumer.
> var handler = typeof(MessageConsumer).GetField("listener",
> BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.NonPublic
> newMessageConsumer.Listener += handler;
> View this message in context:
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.