On Mar 15, 2012, at 1:30 AM, pollotek wrote: > Thank you both for the quick responses, they were very useful and quick. > > I just have one more detail to ask about. In the case where broker1 has no > consumers and broker2 has consumers, the messages are forwarded > automatically to broker2. If one consumer gets attached to broker1 the > messages get dispatched to broker2 and the one local consumer on round-robin > fashion by default. > > Is round-robin considering dispatch 1 message (or batch) to each consumer > attached to broker1 and then 1 message to broker2? or messages would be > dispatched considering the same weight for all consumers no matter what > broker they're on? Meaning if there are 2 consumers on broker2 and 1 in > broker1 and broker1 gets 12 messages, 8 messages would end up going to > broker2 and 3 to the one consumer on broker1?
By default brokers in a network use conduit subscriptions. So all consumers on broker2 are represented by one subscription on broker1. Hence when it comes to dispatching msgs from broker1, all consumers on broker2 count as only one consumer on broker1 (as only one subscription from broker2 to broker1 is established). However you can configure this behavior using the conduitSubscriptions property on your network connector configuration. See http://activemq.apache.org/networks-of-brokers.html for more information. If you have one consumer connected to broker1 and 3 consumers to broker2, then broker1 will dispatch first message to its local consumer, second msg to remote broker2 (which dispatches it to its own consumers in a round robin fashion), third msg to local consumer on broker1, fourth msg to broker2, etc. Torsten Mielke tors...@fusesource.com tmie...@blogspot.com