activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruce Snyder" <bruce.sny...@gmail.com>
Subject Re: Network of Brokers - Broker A talking to Broker B
Date Tue, 19 Feb 2008 03:47:48 GMT
On Feb 15, 2008 2:12 PM, wha <willy.ha@cgi.com> wrote:
>
> Hi,
>
> I'm using the latest snapshot 5.1
>
> I'm having some problems with a really simple setup. I want broker A to send
> its messages to Broker B.
> Broker A has a producer and Broker B has a consumer.
>
> Here's my config for broker A:
>
>   <bean
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
>
>   <broker xmlns="http://activemq.org/config/1.0" brokerName="brokerA"
> dataDirectory="${activemq.base}/data" useJmx="true" advisorySupport="false">
>
>
>     <!-- The transport connectors ActiveMQ will listen to -->
>     <transportConnectors>
>
>        <transportConnector name="openwire" uri="tcp://localhost:61616"
> discoveryUri="multicast://default"/>
>        <transportConnector name="ssl"     uri="ssl://localhost:61617"/>
>        <transportConnector name="stomp"   uri="stomp://localhost:61613"/>
>        <transportConnector name="xmpp"    uri="xmpp://localhost:61222"/>
>
>     </transportConnectors>
>
>     <!-- The store and forward broker networks ActiveMQ will listen to -->
>     <networkConnectors>
>
>       <networkConnector name="host1 and host2"
> uri="static://(tcp://10.166.163.149:61616)" dynamicOnly="true"
> networkTTL="2"/>
>
>     </networkConnectors>
>
>
>
> Here's my config for Broker B:
>
>
>
>  <bean
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
>
>   <broker xmlns="http://activemq.org/config/1.0" brokerName="brokerB"
> dataDirectory="${activemq.base}/data" useJmx="true" advisorySupport="false">
>
>
>     <!-- The transport connectors ActiveMQ will listen to -->
>     <transportConnectors>
>
>        <transportConnector name="openwire" uri="tcp://localhost:61616"
> discoveryUri="multicast://default"/>
>        <transportConnector name="ssl"     uri="ssl://localhost:61617"/>
>        <transportConnector name="stomp"   uri="stomp://localhost:61613"/>
>        <transportConnector name="xmpp"    uri="xmpp://localhost:61222"/>
>
>     </transportConnectors>
>
>     <!-- The store and forward broker networks ActiveMQ will listen to -->
>     <networkConnectors>
>
>       <networkConnector name="host1 and host2"
> uri="static://(tcp://10.166.163.108:61616)" dynamicOnly="true"
> networkTTL="2"/>
>
>     </networkConnectors>

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 - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/

Mime
View raw message