tags:

views:

338

answers:

2

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?

+2  A: 

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.

skaffman
Alright, that makes sense. I guess I should put together some integration tests to validate that AMQ handles this properly...
BenODay
my test confirmed that this does work this way...thanks again
BenODay
A: 

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

Henryk Konsek