activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: Message Group Overlaps and Load Balancing
Date Mon, 27 Nov 2006 17:27:20 GMT
On 11/21/06, taxingmonk <> wrote:
> Hi James,
> To quote: "If you just want load balancing you could use 1 queue with a
> selector
> for each group."
> Yes, that'd be fine, the problem is that I want an overlap. Having done
> further testing I realise this is a flawed notion in and of itself, I'm
> inadvertently expecting a queue to duplicate messages for the overlapping
> selectors.
> Another way to describe the intending behaviour would be to have a set of
> consumers on a topic where groups of consumers could be made where one
> consumer in the group and only one receives a copy of the message for that
> group. Thus I can build a replicated distributed queue. The net result is
> actually identical to using multiple queues and composite destinations.
> I think your suggestion:  "So send a message to an input queue then have a
> farm of routers consuming them and routing them to the correct queue for the
> right group to process it." is the closest, when I was first thinking up a
> solution for this using composite destinations I was hoping to hide the
> building of the composite destination from the sender.  This seems like a
> nice way to do it.

Actually on reflection; Virtual Destinations should be able to use
selectors so you can do exactly what you need. Then you'd not need to
write any code - just configure a virtual destination.

I've patched the Virtual Destination support in trunk so that you can
configure a virtual destination as follows...

  <broker xmlns="">
          <compositeQueue name="MY.QUEUE">
              <filteredDestination selector="foo = 'bar'" queue="Groups.A"/>
              <filteredDestination selector="x = 5" queue="Groups.B"/>

So that if you send to queue MY.QUEUE then messages will be sent to
queues Group.A and Group.B if they match the selectors defined for

More docs on this page...

its all in trunk if you wanna take it for a spin?



View raw message