activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Co <...@exist.com>
Subject Re: Network of Brokers in two JVM into different host
Date Tue, 23 May 2006 08:46:07 GMT


Jerome Camilleri wrote:
> 
> Hi,
> 
>  From previous mail in this list, the following configuration run when 
> you want run two instances of activeMQ in *localhost* :
> 
> <beans xmlns="http://activemq.org/config/1.0">
>  <broker brokerName="broker1" persistent="true" useJmx="false">
>    <transportConnectors>
>      <transportConnector uri="tcp://localhost:60001"
> discoveryUri="multicast://default"/>
>    </transportConnectors>
> 
>    <networkConnectors>
>      <networkConnector uri="multicast://default"/>
>    </networkConnectors>
> 
>    <persistenceAdapter>
>      <memoryPersistenceAdapter/>
>    </persistenceAdapter>
>  </broker>
> </beans>
> 
> But I would like to lauch my two ActiveMQ brokers into *differents* 
> *hosts* : server1 and server2.
> In this configuration, can I used multicast discovery  like this  ?
> 
> <beans xmlns="http://activemq.org/config/1.0">
>  <broker brokerName="broker1" persistent="true" useJmx="false">
>    <transportConnectors>
>      <transportConnector uri="tcp://localhost:60001"
> discoveryUri="multicast://server2:60001"/>
>    </transportConnectors>
> 
>    <networkConnectors>
>      <networkConnector uri="multicast://default"/>
>    </networkConnectors>
> 
>    <persistenceAdapter>
>      <memoryPersistenceAdapter/>
>    </persistenceAdapter>
>  </broker>
> </beans>
> 
> Is seems that brokers don't communicate  between them...
> 

I think the discoveryURI should still be multicast://default for the tcp
connector. In the case above, you're creating a multicast group
server2:60001, but you're network connector is trying to find connections in
the multicast group default, which doesn't have any exposed connectors.



> 
> Should I used static list instead of multicast ?? but in this case I a 
> bit confused about how write my 2 configurations :
> 
> Server1 :
> <beans xmlns="http://activemq.org/config/1.0">
>  <broker brokerName="broker1" persistent="true" useJmx="false">
>    <transportConnectors>
>      <transportConnector uri="tcp://localhost:60001"/>
>    </transportConnectors>
> 
>    <networkConnectors>
>      <networkConnector
> uri="static://(tcp://localhost:61616,tcp://server1:61616)"/>
>    </networkConnectors>
> 
>    <persistenceAdapter>
>      <memoryPersistenceAdapter/>
>    </persistenceAdapter>
>  </broker>
> </beans>
> 
> Server2 :
> 
> <beans xmlns="http://activemq.org/config/1.0">
>  <broker brokerName="broker1" persistent="true" useJmx="false">
>    <transportConnectors>
>      <transportConnector uri="tcp://localhost:60001"/>
>    </transportConnectors>
> 
>    <networkConnectors>
>      <networkConnector
> uri="static://(tcp://localhost:61616,tcp://server2:61616)"/>
>    </networkConnectors>
> 
>    <persistenceAdapter>
>      <memoryPersistenceAdapter/>
>    </persistenceAdapter>
>  </broker>
> </beans>
> 
> All my test failed with a excetion like connection refused...
> 

the network connector for server 1 should be the tcp connector for server2:
   <networkConnectors>
     <networkConnector uri="static://(tcp://<server2 ip/name>:60001)"/>
   </networkConnectors>

vice versa for server 2.

Hope it helps. :)



> 
> Someone could help me pleased ?
> 
> Jérôme
> 
> 
--
View this message in context: http://www.nabble.com/Network+of+Brokers+in+two+JVM+into+different+host-t1524854.html#a4519423
Sent from the ActiveMQ - User forum at Nabble.com.


Mime
View raw message