AmbGup
AmbGup

Reputation: 771

Active MQ - Network of Brokers

I have configured network of brokers with the topology as below.

Clients are configured to use the failover as:

Once Channel-2 goes down P2 and C2 shifts to Channel-1 which is the desired behaviour for failover.

I want to understand the behavior when Chaneel-2 come back? I have noticed it is only Channel-1 which continues to serve all the connections even after Channel-2 has recovered and thus losing load balancing between Channels.

I want to know if it is possible once Channel-2 is back, load balancing will start automatically between channelsand respective Producer-2, Consumers-2 shifts to Channel-2 and thus giving full load balancing and full failover?

I have came across an article 'Combining Fault Tolerance with Load Balancing' on http://fusesource.com/docs/broker/5.4/clustering/index.html is this recommended for combining Fault Tolerance and Load Balancing?

Regards,

-Amber

Upvotes: 4

Views: 1724

Answers (2)

Jerome Thibaud
Jerome Thibaud

Reputation: 477

As an answer to your follow up question: "Is there a way of logging Broker URI as discussed in the article ?"

In order to show what client is connected to what broker, modify the client's Log4j configuration as follow:

<log4j:configuration debug="true"
                     xmlns:log4j="http://jakarta.apache.org/log4j/">

    ...

    <logger name="org.apache.activemq.transport.failover.FailoverTransport">
        <level value="debug"/>
    </logger>

    ...

</log4j:configuration>

Upvotes: 0

whaley
whaley

Reputation: 16265

On both of your brokers, you need to setup your transportConnector to enable updateClusterClients and rebalanceClusterClients.

 <transportConnectors>
   <transportConnector name="tcp-connector" uri="tcp://192.168.0.23:61616" updateClusterClients="true" rebalanceClusterClients="true" /> 
 </<transportConnectors>

Specifically, you should want rebalanceClusterClients. From the docs at http://activemq.apache.org/failover-transport-reference.html it states that:

if true, connected clients will be asked to rebalance across a cluster of brokers when a new broker joins the network of brokers

You must be using ActiveMQ 5.4 or greater to have these options available.

Upvotes: 4

Related Questions