Test broker connection auto-start
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:
tcp://0.0.0.0:6700?autoStart=true;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpMinLargeMessageSize=102400;amqpDuplicateDetection=true
produce message on main broker:
$ main/bin/artemis producer --url tcp://10.0.132.32:61616 --destination queue://TEST.Q5
Connection brokerURL = tcp://10.0.132.32:61616
Producer ActiveMQQueue[TEST.Q5], thread=0 Started to calculate elapsed time ...
Producer ActiveMQQueue[TEST.Q5], thread=0 Produced: 1000 messages
Producer ActiveMQQueue[TEST.Q5], thread=0 Elapsed time in second : 2 s
Producer ActiveMQQueue[TEST.Q5], thread=0 Elapsed time in milli second : 2717 milli seconds
ensure it is not replicated to replica as auto-start is false:
$ 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 |
|activemq.management.b6713e28-cd10-40a5-9d38-5ccc6bb6c014|activemq.management.b6713e28-cd10-40a5-9d38-5ccc6bb6c014|1 |0 |0 |0 |0 |0 |MULTICAST |
start the connection on main broker:
curl -s -H "Origin:http://10.0.132.32:8161" http://admin:admin@10.0.132.32:8161/console/jolokia/exec/org.apache.activemq.artemis:broker=\"0.0.0.0\"/startBrokerConnection\(\java.lang.String\)/DRSite
{"request":{"mbean":"org.apache.activemq.artemis:broker=\"0.0.0.0\"","arguments":["DRSite"],"type":"exec","operation":"startBrokerConnection(java.lang.String)"},"value":null,"timestamp":1607102381,"status":200}
ensure replication occurred to 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 |
|DRSite27a098f2-13d2-4918-a7c1-c17fd8c089a6|DRSite27a098f2-13d2-4918-a7c1-c17fd8c089a6|0 |0 |0 |0 |0 |0 |ANYCAST |
|ExpiryQueue |ExpiryQueue |0 |0 |0 |0 |0 |0 |ANYCAST |
|TEST.Q5 |TEST.Q5 |0 |0 |0 |0 |0 |0 |ANYCAST |
|activemq.management.9878daf4-8174-4030-8889-d6a159d05a18|activemq.management.9878daf4-8174-4030-8889-d6a159d05a18|1 |0 |0 |0 |0 |0 |MULTICAST |