Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JMS consumer with ActiveMQ network of brokers

Tags:

java

jms

activemq

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?

like image 371
Ben ODay Avatar asked Oct 14 '22 09:10

Ben ODay


1 Answers

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.

like image 86
skaffman Avatar answered Oct 18 '22 14:10

skaffman