Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-684

Randoms are not equally distributed, causing Load balance to fail over multiple VMs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.4.0
    • 1.4.0
    • None
    • None

    Description

      When we use each Connection Factory create a single Connection, Client connection are not balanced across cluster with any load balancing policy.
      you can modify the cluster-static-discovery example to reproducer the solution.
      Scenario
      There two nodes in cluster. Nodes in cluster are connected and both nodes have same jms destinations and connection factory defined like the following one

       <connection-factory name="RemoteConnectionFactory" connectors="http-connector" entries="java:jboss/exported/jms/RemoteConnectionFactory" ha="true" connection-ttl="120000" call-timeout="60000" block-on-acknowledge="true" retry-interval="1000" reconnect-attempts="-1" connection-load-balancing-policy-class-name="org.apache.activemq.artemis.api.core.client.loadbalance.RandomConnectionLoadBalancingPolicy"/>
      

      There are clients connecting to cluster. With RandomConnectionLoadBalancingPolicy, I would expect that connections are randomly distributed among the nodes in cluster. However, when I list connections on both nodes (/subsystem=messaging-activemq/server=default:list-connection-ids), all connections are on one server.

      Method private TransportConfiguration selectConnector() in class ServerLocatorImpl checks whether the topologyArray is null and makes decision between choosing connector to other node in topology or initial connector of connection factory. In method private TransportConfiguration selectConnector() topologyArray is still null, so clients make connection using initial connector. It seems like topologyArray is only updated during notifyNodeUp/Down methods.
      Could you please explain how is this client connection balancing supposed to work?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bayern39 Chen Maoqian
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: