JMS consumer with ActiveMQ network of brokers

自闭症网瘾萝莉.ら 提交于 2019-12-04 23:43:25

问题


I have a JMS topic on an ActiveMQ network of brokers cluster (aka distributed topic). I have an external JMS consumer (Weblogic portal) that needs to subscribe to this topic and get all the messages sent to it (across all brokers).

If the consumer subscribes to the topic on one of the brokers, it will only get the subset of the messages that the broker receives, correct?

I guess I could create a consumer for each broker and aggregate the messages together, but then I'm also on the hook for dealing with connection issues and needing to know which brokers are available, etc.

Question, is there a way to configure the network of brokers or consumer to get all the messages from a distributed JMS topic?


回答1:


If the consumer subscribes to the topic on one of the brokers, it will only get the subset of the messages that the broker receives, correct?

Technically, yes, but the broker network is responsible for knowing which consumers are interested in which messages, and making sure that the right brokers get the right messages.

Normally, this means that every broker gets every message, but if a broker only has consumers with a given message selector, it will only get messages that those clients are interested in.

In practise, this means you pick a broker, connect to it, and let the broker network sort it out amongst themselves. In theory.




回答2:


You just connect to the cluster. It is up to the cluster to deliver the messages to the consumer.



来源:https://stackoverflow.com/questions/2255816/jms-consumer-with-activemq-network-of-brokers

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!