activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: EIPs in the ActiveMQ broker and clustering
Date Wed, 05 Sep 2007 13:22:30 GMT
On 9/5/07, jgunz <> wrote:
> I realized after I sent my original message that I didn't specify what type
> of clustering I was referring to. I think I understand how the routing rules
> would work in a master/slave setup but I'm still a little foggy on how they
> would function in a store and forward network of brokers. My goal in
> clustering would be to scale the brokering (and separately the processing)
> across multiple machines so I could just throw more CPUs at the problem if I
> need to later.
> Ideally I'd like to be able to add brokers or consumers without having to
> configure each one specially (or at least only having to do so minimally).

You typically only need a few brokers (usually one is enough :).
Though the processing of the messages can often be costly, so if
you've alot of heavy processing to do, you might wanna run a cluster
of processors processing messages. ActiveMQ is a great high
performance reliable load balancer and is a very good choice for this
purpose thanks to Queues.

So you might find its easier to do your Camel processing using a
spring.xml and wrapping that up with Spring-OSGi to make an OSGi
bundle and deploying it on as many machines as you need. So basically
make an OSGi bundle with your META-INF/spring/camel-context.xml in it
along with whatever jars you need; then just deploy on your OSGi

In terms of the ActiveMQ configuration; its usually just a single URL
which you can either hardwire in your spring.xml or parameterize using
the spring property resolving stuff; if you've only a few brokers you
can just list them using the failover URL...

If you need tons of brokers; you could use multicast discovery, so
JVMs discover the available brokers.

> So if I setup an ActiveMQ installation, if I wanted to improve the
> throughput or capacity I could basically take the same installation and put
> it on another machine and that's it.


> If I did that and I distributed the
> same routing rules to each, would that cause weird message duplication as
> messages were forwarded between brokers and each of them duplicated the
> application of the routing rule?

If you duplicate the Camel processing code to multiple JVMs (using
OSGi or a stand alone main in a shell script or WAR etc) and you use
queues to balance the load then you'll have reliable processing of
messages without duplication (as queues guarantee only one consumer
processes a message). If you are dealing with any unreliable kinds of
messages or protocols, there's always the Idempotent Consumer to

> In regards to OSGi, your suggestion is music to my ears =) That's precisely
> what I was thinking would be an ideal solution. OSGi could potentially allow
> a consumer application to install a routing rule in the broker so I didn't
> have to statically configure them before deployment.
> Thanks for the reply, I'm stoked to get rolling on using some of these great
> features.

My pleasure :)


View raw message