Chapter 4. Verifying the Installation
Abstract
Once the installer has completed running it is a good idea to run a simple test to ensure that Red Hat JBoss A-MQ was properly installed.
JBoss A-MQ ships with a simple client utility that can be used to verify that the software was successfully installed. You use it to create a message producer and a message consumer that connect to the broker. If they run successfully, and you see—by checking the Web console—that the broker processed the messages, then you can be confident that JBoss A-MQ was installed successfully.
To verify that JBoss A-MQ is properly installed:
- Log in as the user with ownership permissions for the JBoss A-MQ installation.
- Open a command shell at
InstallDir
. - Start the broker using the start command.
Windows bin\start.bat Unix ./bin/start - Run the producer client using
java -jar extras/mq-client.jar producer --user admin --password admin
.The producer will connect to the broker and produce 100 messages. Example 4.1, “Test Producer Output” shows the producer's output.Example 4.1. Test Producer Output
$
java -jar extras/mq-client.jar producer --user admin --password admin
Using destination: queue://TEST, on broker: failover://tcp://localhost:61616 [org.apache.activemq.transport.failover.FailoverTransport] : Successfully connected to tcp://localhost:61616 [org.fusesource.mq.ProducerThread] : Sent 'test message: 0' [org.fusesource.mq.ProducerThread] : Sent 'test message: 1' [org.fusesource.mq.ProducerThread] : Sent 'test message: 2' [org.fusesource.mq.ProducerThread] : Sent 'test message: 3' [org.fusesource.mq.ProducerThread] : Sent 'test message: 4' ... [org.fusesource.mq.ProducerThread] : Sent 'test message: 99' [org.fusesource.mq.ProducerThread] : Producer thread finished Produced: 100
$
- Run the consumer client using
java -jar extras/mq-client.jar consumer --user admin --password admin
.The consumer will connect to the broker and consume 100 messages. Example 4.2, “Test Consumer Output” shows the consumer's output.Example 4.2. Test Consumer Output
$
java -jar extras/mq-client.jar consumer --user admin --password admin
Using destination: queue://TEST, on broker: failover://tcp://localhost:61616 [org.apache.activemq.transport.failover.FailoverTransport] : Successfully connected to tcp://localhost:61616 Waiting for: 100 messages [org.fusesource.mq.ConsumerThread] : Received test message: 0 [org.fusesource.mq.ConsumerThread] : Received test message: 1 [org.fusesource.mq.ConsumerThread] : Received test message: 2 [org.fusesource.mq.ConsumerThread] : Received test message: 3 [org.fusesource.mq.ConsumerThread] : Received test message: 4 ... [org.fusesource.mq.ConsumerThread] : Received test message: 99 [org.fusesource.mq.ConsumerThread] : Consumer thread finished Consumed: 100 messages
$