Uploaded image for project: 'AMQ Broker'
  1. AMQ Broker
  2. ENTMQBR-6673

[LTS] FQQN anycast destinations breaks message distribution

XMLWordPrintable

    • False
    • None
    • False
    • Hide

      Deploy a simple cluster on OCP as per CR:

      apiVersion: broker.amq.io/v2alpha5
      kind: ActiveMQArtemis
      metadata:
        name: ex-aao
        application: ex-aao-app
        namespace: amq-broker-test
      spec:
        acceptors:
          - expose: true
            name: acceptor-one
            port: 61626
            protocols: all
        deploymentPlan:
          image: placeholder
          size: 2
          requireLogin: false
          persistenceEnabled: false
          journalType: nio
          messageMigration: false
          jolokiaAgentEnabled: false
          managementRBACEnabled: true 

      and a user defined Address as per CR:

      apiVersion: broker.amq.io/v2alpha3
      kind: ActiveMQArtemisAddress
      metadata:
        generation: 1
        name: ex-aaoaddress
        namespace: amq-broker-test
      spec:
        addressName: myDestination
        applyToCrNames:
          - ex-aao
        queueName: myDestination
        routingType: anycast 

      Start a producer connected to pod 0 and send a bunch of messages

      /opt/amq/bin/artemis producer --sleep 500 --threads 1 --txt-size 0 --message 'Hello World' --message-count 20 --destination 'myDestination::myDestination' --url 'tcp://POD_0_IP:PORT' --verbose 

      Start a consumer connected to pod 1

      /opt/amq/bin/artemis consumer --threads 1 --txt-size 0 --message-count 10 --destination 'myDestination::myDestination' --url 'tcp://POD_1_IP:PORT'--verbose 

      Message are correctly forwarded to broker on pod 1 and consumed. Redistribution happened.

      Now, connect a consumer to pod 0

      /opt/amq/bin/artemis consumer --threads 1 --txt-size 0 --message-count 10 --destination 'myDestination::myDestination' --url 'tcp://POD_0_IP:PORT'--verbose  

      And send another bunch of messages

      Result:

      From now on, messages are consumed only from pod 0, no balancing happens.

       

      Adding an anycast prefix on broker configuration

      apiVersion: broker.amq.io/v2alpha5
      [...]
      spec:
        acceptors:
          - anycastPrefix: jms.queue.
      [...]

      and on producer side

      /opt/amq/bin/artemis producer --sleep 500 --threads 1 --txt-size 0 --message 'Hello World' --message-count 20 --destination 'jms.queue.myDestination::myDestination' --url 'tcp://POD_0_IP:PORT' --verbose 

       seems a workaround as redistribution and balancing start to work.

      Show
      Deploy a simple cluster on OCP as per CR: apiVersion: broker.amq.io/v2alpha5 kind: ActiveMQArtemis metadata:   name: ex-aao   application: ex-aao-app   namespace: amq-broker-test spec:   acceptors:     - expose: true       name: acceptor-one       port: 61626       protocols: all   deploymentPlan:     image: placeholder     size: 2     requireLogin: false     persistenceEnabled: false     journalType: nio     messageMigration: false     jolokiaAgentEnabled: false     managementRBACEnabled: true and a user defined Address as per CR: apiVersion: broker.amq.io/v2alpha3 kind: ActiveMQArtemisAddress metadata:   generation: 1   name: ex-aaoaddress   namespace: amq-broker-test spec:   addressName: myDestination   applyToCrNames:     - ex-aao   queueName: myDestination   routingType: anycast Start a producer connected to pod 0 and send a bunch of messages /opt/amq/bin/artemis producer --sleep 500 --threads 1 --txt-size 0 --message 'Hello World' --message-count 20 --destination 'myDestination::myDestination' --url 'tcp: //POD_0_IP:PORT' --verbose Start a consumer connected to pod 1 /opt/amq/bin/artemis consumer --threads 1 --txt-size 0 --message-count 10 --destination 'myDestination::myDestination' --url 'tcp: //POD_1_IP:PORT' --verbose Message are correctly forwarded to broker on pod 1 and consumed. Redistribution happened. Now, connect a consumer to pod 0 /opt/amq/bin/artemis consumer --threads 1 --txt-size 0 --message-count 10 --destination 'myDestination::myDestination' --url 'tcp: //POD_0_IP:PORT' --verbose And send another bunch of messages Result: From now on, messages are consumed only from pod 0, no balancing happens.   Adding an anycast prefix on broker configuration apiVersion: broker.amq.io/v2alpha5 [...] spec:   acceptors:     - anycastPrefix: jms.queue. [...] and on producer side /opt/amq/bin/artemis producer --sleep 500 --threads 1 --txt-size 0 --message 'Hello World' --message-count 20 --destination 'jms.queue.myDestination::myDestination' --url 'tcp: //POD_0_IP:PORT' --verbose  seems a workaround as redistribution and balancing start to work.

      On OCP 4.9 deployments backed by the 7.9.4-opr-3 operator
      messages distribution (balancing) does not work when using FQQN anycast destinations
      using the same name for Address and Queue (myDestination::myDestination).

              rhn-support-jbertram Justin Bertram
              pmarcon@redhat.com Paolo Marcon (Inactive)
              Tiago Bueno Tiago Bueno
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: