activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiram Chirino" <>
Subject Re: Getting started with ActiveMQ
Date Wed, 26 Jul 2006 18:15:47 GMT
On 7/26/06, jcarreira <> wrote:
> I'm getting started setting up ActiveMQ in a Spring 2.0 based app, so I'm
> configuring it in Spring's XML files (any chance of a Spring 2
> configuration
> extension XSD for ActiveMQ?).

In the latest 4.1-SNAPSHOT we are now support spring 2.0 with xbean so that
might help a bit.  We have a factory bean that you can use create your
broker in your spring file and using a separate activemq.xml file.  But if
you really want to configure everything in 1 spring 2.0 file, I guess adding
an extension xsd would make things easier... Anybody want to submit a patch?

What I'm trying to do is this:
> The app will be deployed in a cluster, backed by Tangosol Coherence
> caching,
> and each node will be independent. I want to be able to drop in new boxes
> to
> join the cluster automatically. JMS in this case is being used to
> integrate
> with another product which will be deployed separately on JBoss with
> JBossMQ. They're building in their side of the JMS integration now. I want
> to own the Queues on my side, and also have them own the Queues on their
> side, and do JMS-to-JMS bridging. This will allow for either side to go
> down
> (although realistically, I expect if anyone goes down it will be the
> single
> JBoss box rather than the cluster on my side) and still be able to Queue
> messages to be handled when the other side comes back up.
> So I've been looking at the ActiveMQ docs, and I'm a little confused.
> - What's the difference between peer and discovery? I suppose discovery
> can
> be used for more than setting up a peer topology. Why doesn't the peer
> configuration use discovery as one of the mechanisms for finding peers? I
> definitely don't want to use multicast for all communication between
> cluster
> nodes.

We have discovery agents and also a discovery transport.  The discovery
transport uses a discovery agent to find brokers and to connect to 1 of
them.  The peer protocol implicitly starts up an embedded broker that is
configured to use a discovery agent so that the broker interconnects with
the other peer brokers.   So, yes peer brokers uses discovery to find
peers.  Our discovery agent (multicast based by default) is only used to
discover other brokers.  The communication between nodes always uses tcp.

- Since peer doesn't use discovery, are there good examples of setting up
> discovery to automatically manage cluster nodes where each uses an
> embedded
> broker? This seems like exactly what peer does, but without discovery
> support...

It seems peer does exactly what you need.

- How does one configure the broker and connection factory in Spring? I have
> the config for the Broker, but there's no relationship / constuctor to
> relate the two. Do I just need to set them up with the same transport
> connector URIs?


Here is a bean that creates a broker that is configured using a
activemq.xmlin the classpath.

    <bean id="brokerContainer" class="
      <property name="config" value="classpath:activemq.xml"/>

And here is a bean that creates an ActiveMQ connection factory to the

    <bean id="factory" class="org.apache.activemq.ActiveMQConnectionFactory
        <property name="brokerURL" value="vm://localhost" />

Note that broker url must match one of the connectors configured for the
broker.  By default, all broker can be accessed using the
"vm://${brokerName}" URL, and the default brokerName is always "localhost"

- I'm confused by the docs about using a SAN for journal files and the
> master-slave docs... Can I set up the nodes to all use a shared drive from
> a
> SAN for the journal and all use the same journal files, or do they each
> need
> their own journal files? I plan to back this with a DB (SQL Server in this
case) but in the interim if a machine goes down, I'd like to not have the
> messages in the journal file lying dormant.

All the brokers can share the SAN.  If you set them up to use the same
journal files on the SAN, then only 1 of the broker instances will be fully
started.  The other instances pointing at the same journal files will wait
for the master to fail before taking over the journal (and fully starting

Ok, I guess that's enough to start...
> Jason
> --
> View this message in context:
> Sent from the ActiveMQ - User forum at



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message