Send messages to the broker

Switch over to the terminals tab (cloud9). Now lets, start sending messages to the queue again. Run the following command in the top left terminals to start the sender:

java -jar ./bin/amazon-mq-client.jar -url $url -mode sender -type queue -destination workshop.queueA -name Sender-1

You should see a log output like the following:

[ActiveMQ Task-1] INFO org.apache.activemq.transport.failover.FailoverTransport - Successfully connected to ssl://b-4e4bfd69-7b83-4a27-9faf-4684cfa80443-2.mq.eu-central-1.amazonaws.com:61617
12.04.2018 12:00:58.369 - Sender: sent '[queue://workshop.queueA] [Sender-1] Message number 1'
12.04.2018 12:00:58.395 - Sender: sent '[queue://workshop.queueA] [Sender-1] Message number 2'
12.04.2018 12:00:58.419 - Sender: sent '[queue://workshop.queueA] [Sender-1] Message number 3'
...

Switch back to the ActiveMQ broker browser window and make sure “Queues” is selected. You should see the “Messages Enqueued” count. Refresh the browser to see this increment.

In the bottom left terminal, run the following command to start the receiver:

java -jar ./bin/amazon-mq-client.jar -url $url -mode receiver -type queue -destination workshop.queueA

You should see a log output like the following:

[ActiveMQ Task-1] INFO org.apache.activemq.transport.failover.FailoverTransport - Successfully connected to ssl://b-4e4bfd69-7b83-4a27-9faf-4684cfa80443-2.mq.eu-central-1.amazonaws.com:61617
12.04.2018 12:01:03.672 - Receiver: received '[queue://workshop.queueA] [Sender-1] Message number 1'
12.04.2018 12:01:03.772 - Receiver: received '[queue://workshop.queueA] [Sender-1] Message number 2'
12.04.2018 12:01:03.673 - Receiver: received '[queue://workshop.queueA] [Sender-1] Message number 3'
...

Switch back to the ActiveMQ broker browser window and make sure “Queues” is selected. You should see the “Messages Dequeued” count. Refresh the browser to see this increment.