ActiveMQ:基于简单主题的集群
好吧,假设我正在构建基于 ActiveMQ 的聊天应用程序。这很简单。只有一个 QUEUE.IN
和一个 TOPIC.OUT
。所有消息都直接从 QUEUE.IN
路由到 TOPIC.OUT
。客户端将聊天消息生成到 QUEUE.IN
并从 TOPIC.OUT
进行消费。就这样。
现在,我想把它聚类。不需要复杂的东西。只需运行几个其他相同的节点(A..N)
。基本上,订阅 A
节点的客户端将消息发送到 A.QUEUE.IN
。此消息必须出现在所有其他节点 (A..N).TOPIC.OUT
上。这可以通过简单的骆驼路由轻松完成,该路由将所有来自 TOPIC.OUT
的消息重新路由到其他节点,但是有一些很好的 ActiveMQ 原生方法可以做到这一点吗?喜欢在多个 AMQ 实例之间共享某些队列/主题吗?
Well, lets say I'm building ActiveMQ based chat application. It's pretty simple. Having only one QUEUE.IN
and one TOPIC.OUT
. All messages are simply routed right away from QUEUE.IN
to TOPIC.OUT
. Clients are producing their chat messages to QUEUE.IN
and consuming from TOPIC.OUT
. That's all.
Now, I wanna cluster it. Don't need something complex. Just run few other identical nodes (A..N)
. Basically, client, subscribed to A
node, sends message to A.QUEUE.IN
. This message must then appear on all other nodes (A..N).TOPIC.OUT
. This could be easily done by simple camel route that re-route all messages comes to TOPIC.OUT
to other nodes, but is there some nice ActiveMQ-native way to do so? Like some queue/topic shared among several AMQ instances?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想你可以在这里找到答案:
http://activemq.apache .org/how-do-distributed-queues-work.html
I think you can find your answer here:
http://activemq.apache.org/how-do-distributed-queues-work.html
您可以使用虚拟目标将消息转发到 activemq 中的多个端点。
http://activemq.apache.org/virtual-destinations.html
You can forward messages to multiple endpoints in activemq using virtual destinations.
http://activemq.apache.org/virtual-destinations.html