0
votes

I have two ActiveMQ brokers in a network setup. The clients are configured with randomize=true and are able to connect fine. However, the messages do not get forwarded from one broker to the other and remain in the queue. For example, I have a particular queue which has multiple producers and one consumer. If I look at the queue on the broker to which the one consumer is connected to, all messages are dequeued immediately. However, on the other broker messages get queued and do not get drained.

Listed below are my networkConnectors and transportConnectors setup for the two brokers. I have tried adding duplex="true" as well as changing the networkTTL to 1 and those didn't seem to make any difference.

BrokerA:

<networkConnectors>
    <networkConnector name="LocalBrokerToB"                    
                    networkTTL="2"
                    uri="static:(tcp://hostnameB:61617)"/>
</networkConnectors>

<transportConnectors>
    <transportConnector name="nioConnectorFront" uri="nio://hostnameA:61616?maximumConnections=1024 "/>
    <transportConnector name="nioConnectorBack" uri="tcp://hostnameA:61617?maximumConnections=1024 "/>
</transportConnectors>

BrokerB:

<networkConnectors>
    <networkConnector name="LocalBrokerToA"                    
                    networkTTL="2"
                    uri="static:(tcp://hostnameA:61617)"/>
</networkConnectors>

<transportConnectors>
    <transportConnector name="nioConnectorFront" uri="nio://hostnameB:61616?maximumConnections=1024 "/>
    <transportConnector name="nioConnectorBack" uri="tcp://hostnameB:61617?maximumConnections=1024 "/>
</transportConnectors>

Any ideas on what could be the problem? An example configuration that someone has working would be a great help.

1

1 Answers

0
votes

You should connect the networkConnector to the transport connector of the other broker. That is port 61616 in your example, not 61617.

You should verify in the broker logs or via Web Console / JMX that the network connection actually gets established.

Adding duplex="true" let's one of the brokers initiate the connection which is great in case of firewalls etc. In your case, that should not matter.