activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wha <>
Subject Re: Network of Brokers - Broker A talking to Broker B
Date Tue, 19 Feb 2008 16:24:31 GMT

bsnyder wrote:
> Disable the all transport connectors (i.e., comment them out) and
> remove the discoverUri from the openwire connectors. I also advise
> running the brokers on the same machine in order to rule out your
> network. In order to do this, you'll need to change the following:
> 1) Make sure the openwire ports for each broker are different for each
> broker
> 2) Make sure the managementContext connectorPorts are different for each
> broker
> 3) Make sure the jetty nioConnector  ports are different for each broker
> These ports need to be unique to each broker so that you can start
> more than one broker on a single machine.
> Next, I'd suggest removing the dynamicOnly attribute until you get the
> broker-to-broker communication working without it. Don't add any extra
> options right now that you don't need beyond the networkTTL. Beyond
> that the network connectors look OK.
> After making these changes, you should be able to start a consumer
> pointing to one broker. Then start the producer pointing to the other
> broker. This is a very, very simple set up that should work without
> problem. I have done this many times myself with both ActiveMQ 4.x and
> 5.x.
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> Apache ActiveMQ -
> Apache Camel -
> Apache ServiceMix -
> Apache Geronimo -
> Blog:

I finally made it work. FiNaLlY!!!!

But first, let me just say that I'm not as smart as you guys, so I really
need dumb down version.

=== Here's a summary of what I learned and followed by another question ===

My objective was simply to do this:      Producer ---> Broker A ---> Broker
B ---> Consumer
I'm using the following snapshot:

1) The transportConnector in the activemq.xml simply specifies the port at
which the Broker will run on.

2) The networkConnector simply specifies to which Broker to connect to.

3) Here's the recipe for my Store and Forward topology (shown above): 
-- On BrokerA define a transportConnector(tcp://localhost:8888) and a
networkConnector to brokerB (tcp://localhost:9999) with dynamicOnly to true
and networkTTL to 2.
-- On BrokerB define only a transportConnector(tcp://localhost:9999) and
importantly put the attribute advisorySupport="true" in the broker tag.
-- The producer connects to tcp://localhost:8888. I simply use the Broker
Web Admin to produce messages, so I don't really need a real producer...
-- The consumer connects to tcp://localhost:9999 and listens for incoming
messages (Hint: MessageListener, onMessage(..))

4) You don't need to define, in the networkConnector tag, the
dynamicallyIncludedDestinations tag or the staticallyIncludedDestination
tag. You can find those info here: 

5) To verify if your brokers are connected, if you are running the
standalone broker from DOS, you should see a line telling you that BrokerA
has established communication with BrokerB.

6) Once you have started up both brokers, start the consumer (that listens
on BrokerB), then go to the Web Admin Queues page on BrokerA, you are
suppose to see the Queue name, that your consumer on BrokerB listens on, in
the list of Queues.

7) Don't use the same broker name for both brokers.

8) For the networkConnector uri, the uri can be something like
uri="static://(tcp://localhost:9991)" OR uri="static:(tcp://localhost:9991)"
(without "//" after "static") both worked for me.

=== My Question ===

My question is about the advisorySupport. Can someone give me a dumb down
explanation as to why it needs to be enabled on BrokerB for the Store and
Forward feature to work ? I've already read about the advisorySupport
documentation on but it doesn't say why it's linked to
the store and forward feature.

Well Thank God I persisted. Now I can resume my tests.

Thanks all for trying to help me. I appreciate it a lot.
- Willy.

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message