ActiveMQ C# + network of brokers

I’m setting up a notification service using ActiveMQ, in C#.
My ActiveMQ topology is a network of brokers: I’ve a pool of brokers and my clients use the failover uri to randomly connect to any of them.
My question is rather simple but I was not able to find the answer:
I want to debug to which broker the messages are originally sent to. Of course i can retrieve the uri used to create my connectionFactory, but this doesn’t really help.
Any idea on how to catch to which specific broker of the network of brokers the message is sent to?

Thank you very much,

Seb

The broker id that has received the message should be in the ActiveMQMessage itself. I don’t know the property by heart for NMS but you should take a look at the underlying message:

(myMessage as ActiveMQMessage).BrokerPath might be your best bet.

Leave a Comment