You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by crgr <cr...@gmail.com> on 2010/03/19 17:05:06 UTC

ActiveMQ over different subnets

Hi,

I am trying to make an ActiveMQ network of brokers work over different
subnetworks. Inside the subnetworks I use multicast for auto discovery
between the brokers, but this isn't an option for connecting  brokers in
different subnets. The requirements are that each subnet can have publishers
and subscribers and that subscribers can subscribe to topics produced in a a
different subnet. I am not concerned with queues at the moment. To provide
communication across subnets, in each subnet, I use two special brokers that
are supporting the communication with the other subnet. One broker is just
for receiving and the other is just for sending.
	    
The configuration for the brokers is like this:

1. Broker inside each subnet:

<networkConnectors>
  <networkConnector 
    uri="multicast://default"
    dynamicOnly = "true" 
    prefetchSize = "1" />		
  <networkConnector 
    uri="static://(tcp://OutHost:61617)"
    name = "toOutside"
    duplex = "false"
    dynamicOnly = "false"
    networkTTL = "1"/>
  <networkConnector 
    uri="static://(tcp://InHost:61618)"
    name = "fromOutside"
    duplex = "true"
    dynamicOnly = "false"
    networkTTL = "3">
   <excludedDestinations>
     <topic physicalName = "MyTopic" />
   </excludedDestinations>
   </networkConnector>
</networkConnectors>
		
<transportConnectors>
  <transportConnector 
uri="tcp://0.0.0.0:61616?transport.keepAliveResponseRequired=true" 
discoveryUri="multicast://default" />		
</transportConnectors>

2. Broker that is sending to the other subnetwork(OutHost):

  <networkConnectors>	
    <networkConnector 
      uri="static://(tcp://OutsideHost:61619)"
      duplex = "false"
      dynamicOnly = "false"
      networkTTL = "2"/>
    </networkConnectors>
	
  <transportConnectors>
    <transportConnector 
uri="tcp://0.0.0.0:61617?transport.keepAliveResponseRequired=true" />	
  </transportConnectors>

3.Broker that is receiving from the other subnetwork(InHost):

  <networkConnectors/>	

  <transportConnectors>
    <transportConnector name="Subnet"
uri="tcp://0.0.0.0:61618?transport.keepAliveResponseRequired=true" />	
    <transportConnector name="Outside" uri="tcp://0.0.0.0:61619?
transport.keepAliveResponseRequired=true" />	
  </transportConnectors>

I've run some tests with 2 subnetworks, 2 non-special brokers on each
subnetwork and 2 clients on each broker. One of these clients publishes on
its own topic and the other client subscribes to all four topics. All the
brokers are configured with the persistent attribute set to false and all
consumers are not durable.  
There are several problems that I cannot figure out. 

1.Unless I start clients that subscribe to the topics on OutHost for subnet1
and on InHost for subnet2 messages are not passing from subnet1 to subnet2,
and vice versa. 
As long as the chain of connections between a inner broker on subnet1 and a
inner broker on subnet2 contains only connections with dynamicOnly set to
false shouldn't this not happen? 
2.Sometimes I am receiving duplicate messages on the final clients(those on
the brokers inside the subnets) or sometimes messages on this clients are
missing. The duplicated messages are coming from the other subnet.

Maybe my broker topology is too complicated and all I want to achieve can be
done in a simpler way. Any advice would be very helpful.

Thanks,
Cristi


        
-- 
View this message in context: http://old.nabble.com/ActiveMQ-over-different-subnets-tp27950991p27950991.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.