ActiveMQ C# +经纪人网络
我正在 C# 中使用 ActiveMQ 设置通知服务。 我的 ActiveMQ 拓扑是一个代理网络:我有一个代理池,我的客户端使用故障转移 uri 随机连接到其中任何一个。 我的问题很简单,但我找不到答案: 我想调试消息最初发送到哪个代理。当然,我可以检索用于创建我的 connectionFactory
的 uri,但这并没有真正的帮助。 关于如何捕获消息发送到代理网络中的哪个特定代理的任何想法?
非常感谢你,
塞布
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
已接收消息的代理 ID 应位于 ActiveMQMessage 本身中。我不知道 NMS 的属性,但您应该看一下底层消息:
(myMessage as ActiveMQMessage)。BrokerPath 可能是您最好的选择。
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.