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

amqpconnection does not sync properly when there are two pair of brokers.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • None
    • disaster-recovery
    • None
    • False
    • None
    • False
    • Medium
    • ARTEMIS-3753
    • Workaround Exists
    • Hide

      use replica to 1 instead of 2. 

      Show
      use replica to 1 instead of 2. 
    • Hide

      Create two NS   
       oc new-project dc0
       oc new-project dc1

       

      Install AMQ710 operator
       Operator hub
       

       

      Create TLS secrets 

       
       1126  keytool -genkey -alias broker -keyalg RSA -keystore broker.ks
       1128  keytool -export -alias broker -keystore broker.ks -file broker_cert
       1129  keytool -import -alias broker -keystore client.ts -file broker_cert
       1130  keytool -genkey -alias broker -keyalg RSA -keystore broker.ts
      
      oc delete secret ssl-amqp-secret -n dc0
      oc delete secret ssl-amqp-secret -n dc1
      
      oc create secret generic ssl-amqp-secret \
      --from-file=broker.ks \
      --from-literal=keyStorePassword=password \
      --from-file=client.ts=broker.ts \
      --from-literal=trustStorePassword=password \
      -n dc0
      
      oc create secret generic ssl-amqp-secret \
      --from-file=broker.ks \
      --from-literal=keyStorePassword=password \
      --from-file=client.ts=broker.ts \
      --from-literal=trustStorePassword=password \
      -n dc1
       
      

       

      Creating brokers 

       oc create -f dc0.yaml -n dc0
       oc create -f dc1.yaml -n dc1

       

      dc0.yaml

      apiVersion: broker.amq.io/v1beta1
      kind: ActiveMQArtemis
      metadata:
        name: dc0
      spec:
        brokerProperties:
          - AMQPConnections.dc1.uri=tcp://dc1-ssl-amqp-${STATEFUL_SET_ORDINAL}-svc-rte-dc1.apps.ocp4.ocp.domain:443?clientFailureCheckPeriod=2000&connectionTTL=5000&sslEnabled=true&verifyHost=false&trustAll=true&trustStorePath=/etc/ssl-amqp-secret-volume/client.ts&trustStorePassword=password
          - AMQPConnections.dc1.retryInterval=5000
          - AMQPConnections.dc1.reconnectAttempts=-1
          - AMQPConnections.dc1.user=admin
          - AMQPConnections.dc1.password=admin
          - AMQPConnections.dc1.autoStart=true
          - AMQPConnections.dc1.connectionElements.mirror.type=MIRROR
          - AMQPConnections.dc1.connectionElements.mirror.messageAcknowledgements=true
          - AMQPConnections.dc1.connectionElements.mirror.queueCreation=true
          - AMQPConnections.dc1.connectionElements.mirror.queueRemoval=true
          
        deploymentPlan:
          size: 2
          image: placeholder
          requireLogin: true
          persistenceEnabled: false
          journalType: nio
          messageMigration: false
          jolokiaAgentEnabled: true
          managementRBACEnabled: true
        adminUser: admin
        adminPassword: admin
        console:
          expose: true
        acceptors:
        - name: all
          protocols: all
          port: 61616
          expose: true
        - name: ssl-amqp
          port: 5673
          protocols: amqp
          sslEnabled: true
          sslSecret: ssl-amqp-secret
          verifyHost: false
          expose: true
        addressSettings:
          addressSetting:
          - deadLetterAddress: TEST_QUEUE_DEAD_LETTER
            match: TEST_QUEUE
            maxDeliveryAttempts: 5// code placeholder
      

      dc1.yaml

       

      apiVersion: broker.amq.io/v1beta1
      kind: ActiveMQArtemis
      metadata:
        name: dc1
      spec:
        deploymentPlan:
          size: 2
          image: placeholder
          requireLogin: true
          persistenceEnabled: false
              #    persistenceEnabled: true
              #    storage:
              #      size: 10G
              #      storageClassName: local
          journalType: nio
          messageMigration: false
          jolokiaAgentEnabled: true
          managementRBACEnabled: true
        adminUser: admin
        adminPassword: admin
        console:
          expose: true
        acceptors:
        - name: all
          protocols: all
          port: 61616
          expose: true
        - name: ssl-amqp
          port: 5673
          protocols: amqp
          sslEnabled: true
          sslSecret: ssl-amqp-secret
          verifyHost: false
          expose: true
        addressSettings:
          addressSetting:
          - deadLetterAddress: TEST_QUEUE_DEAD_LETTER
            match: TEST_QUEUE
            maxDeliveryAttempts: 5 

       Use amqp producer to send messages

      $AMQ7_HOME/bin/artemis producer --user admin --password admin --url 'amqps://dc0-ssl-amqp-0-svc-rte-dc0.apps.ocp4.ocpdomain:443?transport.trustStoreLocation=./tls/client.ts&transport.trustStorePassword=password&transport.verifyHost=false' --protocol amqp --verbose
      
      

       x 2 (send 2000 messages) 

      Check the web console on TEST count on both dc0-ss-0 and dc1-ss-0 you will see 2000 

      Use amqp consumer 1000 messages

      $AMQ7_HOME/bin/artemis consumer --user admin --password admin --url 'amqps://dc0-ssl-amqp-0-svc-rte-dc0.apps.ocp4.ocpdomain:443?transport.trustStoreLocation=./tls/client.ts&transport.trustStorePassword=password&transport.verifyHost=false' --protocol amqp --verbose

      Check the web console on TEST count

      dc0-ss-0 show 1000

      dc1-ss-0 show 1500 

       

      Use amqp consumer 1000 messages (again)

      $AMQ7_HOME/bin/artemis consumer --user admin --password admin --url 'amqps://dc0-ssl-amqp-0-svc-rte-dc0.apps.ocp4.ocpdomain:443?transport.trustStoreLocation=./tls/client.ts&transport.trustStorePassword=password&transport.verifyHost=false' --protocol amqp --verbose

      Check the web console on TEST count

      dc0-ss-0 show 0

      dc1-ss-0 show 1000 

      Show
      Create two NS     oc new-project dc0  oc new-project dc1   Install AMQ710 operator  Operator hub     Create TLS secrets     1126  keytool -genkey -alias broker -keyalg RSA -keystore broker.ks  1128  keytool -export -alias broker -keystore broker.ks -file broker_cert  1129  keytool - import -alias broker -keystore client.ts -file broker_cert  1130  keytool -genkey -alias broker -keyalg RSA -keystore broker.ts oc delete secret ssl-amqp-secret -n dc0 oc delete secret ssl-amqp-secret -n dc1 oc create secret generic ssl-amqp-secret \ --from-file=broker.ks \ --from-literal=keyStorePassword=password \ --from-file=client.ts=broker.ts \ --from-literal=trustStorePassword=password \ -n dc0 oc create secret generic ssl-amqp-secret \ --from-file=broker.ks \ --from-literal=keyStorePassword=password \ --from-file=client.ts=broker.ts \ --from-literal=trustStorePassword=password \ -n dc1     Creating brokers   oc create -f dc0.yaml -n dc0  oc create -f dc1.yaml -n dc1   dc0.yaml apiVersion: broker.amq.io/v1beta1 kind: ActiveMQArtemis metadata:   name: dc0 spec:   brokerProperties:     - AMQPConnections.dc1.uri=tcp: //dc1-ssl-amqp-${STATEFUL_SET_ORDINAL}-svc-rte-dc1.apps.ocp4.ocp.domain:443?clientFailureCheckPeriod=2000&connectionTTL=5000&sslEnabled= true &verifyHost= false &trustAll= true &trustStorePath=/etc/ssl-amqp-secret-volume/client.ts&trustStorePassword=password     - AMQPConnections.dc1.retryInterval=5000     - AMQPConnections.dc1.reconnectAttempts=-1     - AMQPConnections.dc1.user=admin     - AMQPConnections.dc1.password=admin     - AMQPConnections.dc1.autoStart= true     - AMQPConnections.dc1.connectionElements.mirror.type=MIRROR     - AMQPConnections.dc1.connectionElements.mirror.messageAcknowledgements= true     - AMQPConnections.dc1.connectionElements.mirror.queueCreation= true     - AMQPConnections.dc1.connectionElements.mirror.queueRemoval= true        deploymentPlan:     size: 2     image: placeholder     requireLogin: true     persistenceEnabled: false   journalType: nio     messageMigration: false     jolokiaAgentEnabled: true     managementRBACEnabled: true   adminUser: admin   adminPassword: admin   console:     expose: true   acceptors:   - name: all     protocols: all     port: 61616     expose: true   - name: ssl-amqp     port: 5673     protocols: amqp     sslEnabled: true     sslSecret: ssl-amqp-secret     verifyHost: false     expose: true   addressSettings:     addressSetting:     - deadLetterAddress: TEST_QUEUE_DEAD_LETTER       match: TEST_QUEUE       maxDeliveryAttempts: 5 // code placeholder dc1.yaml   apiVersion: broker.amq.io/v1beta1 kind: ActiveMQArtemis metadata:   name: dc1 spec:   deploymentPlan:     size: 2     image: placeholder     requireLogin: true     persistenceEnabled: false         #    persistenceEnabled: true         #    storage:         #      size: 10G         #      storageClassName: local     journalType: nio     messageMigration: false     jolokiaAgentEnabled: true     managementRBACEnabled: true   adminUser: admin   adminPassword: admin   console:     expose: true   acceptors:   - name: all     protocols: all     port: 61616     expose: true   - name: ssl-amqp     port: 5673     protocols: amqp     sslEnabled: true     sslSecret: ssl-amqp-secret     verifyHost: false     expose: true   addressSettings:     addressSetting:     - deadLetterAddress: TEST_QUEUE_DEAD_LETTER       match: TEST_QUEUE       maxDeliveryAttempts: 5  Use amqp producer to send messages $AMQ7_HOME/bin/artemis producer --user admin --password admin --url 'amqps: //dc0-ssl-amqp-0-svc-rte-dc0.apps.ocp4.ocpdomain:443?transport.trustStoreLocation=./tls/client.ts&transport.trustStorePassword=password&transport.verifyHost= false ' --protocol amqp --verbose  x 2 (send 2000 messages)  Check the web console on TEST count on both dc0-ss-0 and dc1-ss-0 you will see 2000  Use amqp consumer 1000 messages $AMQ7_HOME/bin/artemis consumer --user admin --password admin --url 'amqps: //dc0-ssl-amqp-0-svc-rte-dc0.apps.ocp4.ocpdomain:443?transport.trustStoreLocation=./tls/client.ts&transport.trustStorePassword=password&transport.verifyHost= false ' --protocol amqp --verbose Check the web console on TEST count dc0-ss-0 show 1000 dc1-ss-0 show 1500    Use amqp consumer 1000 messages (again) $AMQ7_HOME/bin/artemis consumer --user admin --password admin --url 'amqps: //dc0-ssl-amqp-0-svc-rte-dc0.apps.ocp4.ocpdomain:443?transport.trustStoreLocation=./tls/client.ts&transport.trustStorePassword=password&transport.verifyHost= false ' --protocol amqp --verbose Check the web console on TEST count dc0-ss-0 show 0 dc1-ss-0 show 1000 
    • Important

      Say you have dc0 mirroring dc1 and each has a cluster of two brokers. 

      producer and consumer are only on dc0 and it has inconsistent message count in dc1. 

      For example 

      sending 2000 messages to dc0-ss0 and it got replicate to dc1-ss0 

      then consume 1000 messages 

      dc0-ss0 show 1000 messages but dc1-ss0 shows 1500 

      then consume 1000 messages 

      dc0-ss0 show 0 messages but dc1-ss0 shows 1000 

      If replicas is 1, the sync work. 

       

       

       

              csuconic@redhat.com Clebert Suconic
              rhn-support-whui Roger Hui
              Votes:
              3 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: