Test mirror between a main and replica brokers with default options but source-mirror-address defined and check if messages are (or are not) replicated after a broker restart Main: created a broker with command: $ amq-broker-7.8.0/bin/artemis create main --user admin --password admin --allow-anonymous added to the config: Replica: created a broker with command: $ artemis create --user admin --password admin --allow-anonymous ~/replica added to the config: an acceptor: tcp://0.0.0.0:6700?autoStart=true;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpMinLargeMessageSize=102400;amqpDuplicateDetection=true ensure the queue MY.MIRROR.Q is created on main broker after it starts: $ main/bin/artemis queue stat --url tcp://10.0.132.32:61616 Connection brokerURL = tcp://10.0.132.32:61616 |NAME |ADDRESS |CONSUMER_COUNT |MESSAGE_COUNT |MESSAGES_ADDED |DELIVERING_COUNT |MESSAGES_ACKED |SCHEDULED_COUNT |ROUTING_TYPE | |DLQ |DLQ |0 |0 |0 |0 |0 |0 |ANYCAST | |ExpiryQueue |ExpiryQueue |0 |0 |0 |0 |0 |0 |ANYCAST | |MY.MIRROR.Q |MY.MIRROR.Q |1 |0 |14 |0 |14 |0 |ANYCAST | |activemq.management.fe92efa1-55ef-4ee7-9068-1fa0ad469b0d|activemq.management.fe92efa1-55ef-4ee7-9068-1fa0ad469b0d|1 |0 |0 |0 |0 |0 |MULTICAST | ensure the queue MY.MIRROR.Q is created on replica broker after it starts: $ main/bin/artemis queue stat --url tcp://10.0.134.16:61616 Connection brokerURL = tcp://10.0.134.16:61616 |NAME |ADDRESS |CONSUMER_COUNT |MESSAGE_COUNT |MESSAGES_ADDED |DELIVERING_COUNT |MESSAGES_ACKED |SCHEDULED_COUNT |ROUTING_TYPE | |DLQ |DLQ |0 |0 |0 |0 |0 |0 |ANYCAST | |ExpiryQueue |ExpiryQueue |0 |0 |0 |0 |0 |0 |ANYCAST | |MY.MIRROR.Q |MY.MIRROR.Q |0 |0 |0 |0 |0 |0 |ANYCAST | |activemq.management.ba1da8b4-34f8-490c-9bf4-b8759ac6ad6e|activemq.management.ba1da8b4-34f8-490c-9bf4-b8759ac6ad6e|1 |0 |0 |0 |0 |0 |MULTICAST | ensure the MY.MIRROR.Q queue is durable and anycast on main broker: $ curl -s -H "Origin:http://10.0.132.32:8161" http://admin:admin@10.0.134.16:8161/console/jolokia/read/org.apache.activemq.artemis:broker=\"0.0.0.0\",component=addresses,address=\"MY.MIRROR.Q\",subcomponent=queues,routing-type=\"anycast\",queue=\"MY.MIRROR.Q\" |jq '.' |egrep -i '(RoutingType|"Durable")' "RoutingType": "ANYCAST", "Durable": true, ensure the MY.MIRROR.Q queue is durable and anycast on replica broker: curl -s -H "Origin:http://10.0.134.16:8161" http://admin:admin@10.0.134.16:8161/console/jolokia/read/org.apache.activemq.artemis:broker=\"0.0.0.0\",component=addresses,address=\"MY.MIRROR.Q\",subcomponent=queues,routing-type=\"anycast\",queue=\"MY.MIRROR.Q\" |jq '.' |egrep -i '(RoutingType|"Durable")' "RoutingType": "ANYCAST", "Durable": true, create a queue to send messages: $ main/bin/artemis queue create --durable --anycast --address MY.TEST.Q --name MY.TEST.Q --url tcp://10.0.132.32:61616 Connection brokerURL = tcp://10.0.132.32:61616 --purge-on-no-consumers: is a mandatory property! Purge the contents of the queue once there are no consumers, valid values are Y,N,True,False False --auto-create-address: is a mandatory property! should auto create the address if it doesn't exist, valid values are Y,N,True,False Y Queue [name=MY.TEST.Q, address=MY.TEST.Q, routingType=ANYCAST, durable=true, purgeOnNoConsumers=false, autoCreateAddress=false, exclusive=false, lastValue=false, lastValueKey=null, nonDestructive=false, consumersBeforeDispatch=0, delayBeforeDispatch=-1, autoCreateAddress=false] created successfully. stop the replica broker and on main broker you must see the log message like below: ******************************************************************************************************************************* Retrying Server AMQP Connection DRSite on 10.0.134.16:6700 retry 1 of -1 ******************************************************************************************************************************* send messages to MY.TEST.Q on main broker: $ main/bin/artemis producer --url tcp://10.0.132.32:61616 --destination queue://MY.TEST.Q Connection brokerURL = tcp://10.0.132.32:61616 Producer ActiveMQQueue[MY.TEST.Q], thread=0 Started to calculate elapsed time ... Producer ActiveMQQueue[MY.TEST.Q], thread=0 Produced: 1000 messages Producer ActiveMQQueue[MY.TEST.Q], thread=0 Elapsed time in second : 2 s Producer ActiveMQQueue[MY.TEST.Q], thread=0 Elapsed time in milli second : 2370 milli seconds ensure there are message on MY.TEST.Q on main broker: $ main/bin/artemis queue stat --url tcp://10.0.132.32:61616 Connection brokerURL = tcp://10.0.132.32:61616 |NAME |ADDRESS |CONSUMER_COUNT |MESSAGE_COUNT |MESSAGES_ADDED |DELIVERING_COUNT |MESSAGES_ACKED |SCHEDULED_COUNT |ROUTING_TYPE | |DLQ |DLQ |0 |0 |0 |0 |0 |0 |ANYCAST | |ExpiryQueue |ExpiryQueue |0 |0 |0 |0 |0 |0 |ANYCAST | |MY.MIRROR.Q |MY.MIRROR.Q |0 |1002 |1021 |0 |19 |0 |ANYCAST | |MY.TEST.Q |MY.TEST.Q |0 |1000 |1000 |0 |0 |0 |ANYCAST | |activemq.management.b9901b19-77f8-48c8-a8a3-83f5c67f4847|activemq.management.b9901b19-77f8-48c8-a8a3-83f5c67f4847|1 |0 |0 |0 |0 |0 |MULTICAST | stop the main broker and start again and check if the number of messages on MY.MIRROR.Q still the same (or at least near the expectation of 1000 messages): main/bin/artemis queue stat --url tcp://10.0.132.32:61616 Connection brokerURL = tcp://10.0.132.32:61616 |NAME |ADDRESS |CONSUMER_COUNT |MESSAGE_COUNT |MESSAGES_ADDED |DELIVERING_COUNT |MESSAGES_ACKED |SCHEDULED_COUNT |ROUTING_TYPE | |DLQ |DLQ |0 |0 |0 |0 |0 |0 |ANYCAST | |ExpiryQueue |ExpiryQueue |0 |0 |0 |0 |0 |0 |ANYCAST | |MY.MIRROR.Q |MY.MIRROR.Q |0 |20 |20 |0 |0 |0 |ANYCAST | |MY.TEST.Q |MY.TEST.Q |0 |1000 |1000 |0 |0 |0 |ANYCAST | |activemq.management.48b1279a-c6aa-4293-b0fa-7f1e23456f5a|activemq.management.48b1279a-c6aa-4293-b0fa-7f1e23456f5a|1 |0 |0 |0 |0 |0 |MULTICAST | At this point, the messages on the MY.MIRROR.Q was reduced to 20 and after starting the replica broker, the message from MY.TEST.Q are not replicated to the replica: $ main/bin/artemis queue stat --url tcp://10.0.134.16:61616 Connection brokerURL = tcp://10.0.134.16:61616 |NAME |ADDRESS |CONSUMER_COUNT |MESSAGE_COUNT |MESSAGES_ADDED |DELIVERING_COUNT |MESSAGES_ACKED |SCHEDULED_COUNT |ROUTING_TYPE | |DLQ |DLQ |0 |0 |0 |0 |0 |0 |ANYCAST | |ExpiryQueue |ExpiryQueue |0 |0 |0 |0 |0 |0 |ANYCAST | |MY.MIRROR.Q |MY.MIRROR.Q |0 |0 |0 |0 |0 |0 |ANYCAST | |MY.TEST.Q |MY.TEST.Q |0 |0 |0 |0 |0 |0 |ANYCAST | |activemq.management.f88dbfcc-5ab4-424e-9f66-8ba7707f918a|activemq.management.f88dbfcc-5ab4-424e-9f66-8ba7707f918a|1 |0 |0 |0 |0 |0 |MULTICAST |