All,

Another question on Network of Brokers.  How exactly does one set up
multiple connections between two brokers?  The documentation indicates that
defining multiple network connectors in the broker configuration should
achieve this, but we seem to be unable to correctly configure this.

Again, using Broker A and Broker B as the two brokers, I’ve tried the
following configuration (using Broker A’s configuration below) with the
following results:

I first tried defining multiple <networkConnector> elments pointing to the
same machine
<transportConnectors>
        <transportConnector name="default-tc1" uri="tcp://localhost:61616" />
</transportConnectors>
<networkConnectors>
        <networkConnector name="default-nc1" 
uri="static://(tcp://machineB:61616)"
dynamicOnly="true"/>
<networkConnector name="default-nc2" uri="static://(tcp://machineB:61616)"
dynamicOnly="true"/>
</networkConnectors>
The above errors out with a multiple ports in use exception at startup.

I then tried two network connectors on different ports:
<transportConnectors>
        <!—two transports are defined here as BrokerB also has a two port
connection back 
        <transportConnector name="default-tc1" uri="tcp://localhost:61616" />
        <transportConnector name="default-tc2" uri="tcp://localhost:61617" />
</transportConnectors>
<networkConnectors>
        <networkConnector name="default-nc1" 
uri="static://(tcp://machineB:61616)"
dynamicOnly="true"/>
<networkConnector name="default-nc2" uri="static://(tcp://machineB:61617)"
dynamicOnly="true"/>
</networkConnectors>

However, when the second broker starts both would exception: 
Broker A’s exception:
WARN  TransportConnection            - Failed to add Connection
javax.jms.InvalidClientIDException: Broker: BrokerB - Client:
NC_BrokerA_outbound already connected from /192.168.10.167:1473

Broker B’s exception:
WARN  TransportConnection            - Failed to add Connection
javax.jms.InvalidClientIDException: Broker: BrokerA - Client:
NC_BrokerB_outbound already connected from /192.168.10.164:4134

I then tried
<networkConnectors>
        <networkConnector name="default-nc1" 
uri="static://(tcp://machineB:61616,
tcp://machineB:61616)" dynamicOnly="true"/>
</networkConnector>
…no exception, but I believe that this just drops into a round-robin scheme
and netstating the connections, I did not see multiple connections between
the two boxes.

Lastly, I tried adding multiple Network Connectors, 
<networkConnectors>
  <!—configuration goes here -->
</networkConnectors>
<networkConnectors>
  <!—configuration goes here -->
</networkConnectors>
However, I found that only the last <networkConnectors> element is read by
ActiveMQ, so the first elements configuration is ignored or overwritten.

Any thoughts?  I believe that when I figure out the configuration error, I
should see multiple outbound connections via netstat, correct?

Thanks,

Eric

-- 
View this message in context: 
http://www.nabble.com/Defining-Multiple-Network-Connectors-in-a-Network-of-Brokers-tp14744240s2354p14744240.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to