Search code examples
activemq-artemis

ActiveMQ Artemis connection-router question


I'm trying to set up a broker with two connection routers to two different clusters using ROUND_ROBIN as the policy. However, when I start the broker, I'm getting this error:

AMQ214019: Invalid configuration

Caused by: org.xml.sax.SAXParseException; cvc-id.2: There are multiple occurrences of ID value 'ROUND_ROBIN'.

If I change the policy to any other non-duplicated value, the broker starts normally.

version 2.35.0

         <acceptor name="artemis-dsv">tcp://0.0.0.0:61616?router=evenly-balance;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;amqpMinLargeMessageSize=102400;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true;supportAdvisory=false;suppressInternalManagementObjects=false</acceptor>

         <acceptor name="artemis-hmg">tcp://0.0.0.0:62626?router=router-hmg;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;amqpMinLargeMessageSize=102400;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true;supportAdvisory=false;suppressInternalManagementObjects=false</acceptor>

      </acceptors>
      <connection-routers>
         <connection-router name="evenly-balance">
            <key-type>CLIENT_ID</key-type>
            <key-filter>^.{3}</key-filter>
            <policy name="ROUND_ROBIN"/>
            <pool>
               <username>xxx</username>
               <password>yyy</password>
               <static-connectors>
                  <connector-ref>server1</connector-ref>
                  <connector-ref>server2</connector-ref>
               </static-connectors>
            </pool>
         </connection-router>
         <connection-router name="router-hmg">
            <key-type>CLIENT_ID</key-type>
            <key-filter>^.{3}</key-filter>
            <policy name="ROUND_ROBIN"/>
            <pool>
               <username>zzz</username>
               <password>ccc</password>
               <static-connectors>
                  <connector-ref>server3</connector-ref>
                  <connector-ref>server4</connector-ref>
               </static-connectors>
            </pool>
         </connection-router>

Is it possible to use one connection router broker for different clusters ?


Solution

  • This is a bug. I created the issue ARTEMIS-4951. The fix will be included in Apache ActiveMQ Artemis 2.36.0 which is due to be released in the next few weeks.