简体   繁体   English

跨集群的JMS消息跟踪

[英]JMS Message tracking across clusters

I have JMS implementation based on JBoss (to be precise, JBossMQ on JBoss4.2). 我有基于JBoss的JMS实现(确切地说,是JBoss4.2上的JBossMQ)。 There are 5 clusters, with each cluster having few nodes. 有5个群集,每个群集只有很少的节点。 One node in each of the cluster acts as master node. 每个群集中的一个节点充当主节点。 Out of the 5 clusters, one of the cluster is supposed to publish messages to a persistent Topic, and the other 4 clusters consumes those messages. 在这5个集群中,其中一个集群应该将消息发布到持久主题,而其他4个集群将使用这些消息。 The publishing and consuming is done by only the master node of each cluster. 发布和使用仅由每个群集的主节点完成。

I want to device a mechanism where the publisher knows that the message was consumed by all the subscribers or a subscriber knows that it has consumed all the messages produced by the publisher. 我想提供一种机制,使发布者知道该消息已被所有订阅者使用,或者订阅者知道它已消耗了发布者产生的所有消息。 How can this be achieved? 如何做到这一点?

In principle, you use a JMS system in order to not care about that and only configure it the way you need. 原则上,您使用JMS系统是为了不关心它,而仅按照您需要的方式对其进行配置。 You could save state information in a shared resource like a database, but I wouldn't do it. 您可以将状态信息保存在共享资源(如数据库)中,但我不会这样做。 Better use monitor features of the JMS system in order to track that. 更好地使用JMS系统的监视功能来进行跟踪。 In case your application really needs to know about the successful processing of a message, then you could have a queue where process acknowledge go back to the sender. 如果您的应用程序确实需要了解消息的成功处理,那么您可以将一个队列,其中流程确认返回给发送者。

For HornetQ, which you might use with JBoss, you'll find an example of a clustered topic here . 对于可能与JBoss一起使用的HornetQ,您可以在此处找到一个集群主题的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM