Set up your development environment
Setting up your development environment involves downloading and installing Red Hat AMQ Broker:
Download the latest version of AMQ Broker. The latest version at the time of this writing is Red Hat AMQ Broker 7.7 GA.
Unzip AMQ Broker to any destination. This document will refer to this directory as
On Windows or Mac, extract the contents of the ZIP archive by double-clicking on the ZIP file.
On Red Hat Enterprise Linux, open a terminal window in the target machine and navigate to where the ZIP file was downloaded. Extract the ZIP file by executing the following command:
$ unzip amq-broker-7.7.0-bin.zip
Create and run an AMQ Broker instance
artemis script located in the
bin folder is the starting point for managing our AMQ installation:
Create a broker instance. Execute the following command to create a new broker in the instances folder.
$ <AMQ_HOME>/bin/artemis create --user admin --password password --role admin --allow-anonymous y <AMQ_HOME>/instances/mybroker
This command creates a broker in the
<AMQ_HOME>/instances/mybrokerfolder, with the admin default user assigned to the admin role and their password set to password. This broker also accepts anonymous users connecting to the broker from localhost. The folder where the broker is installed is referred to as
Start the broker instance:
To start the broker, run this command from the
$ bin/artemis run
After you run this command, a console log will appear and the broker will be running.
Start using the broker
Examples of how to produce and consume messages:
- Send 1000 messages to the broker:
Consume messages from broker:
You just sent and received messages via Red Hat AMQ Broker. Visit frequently to view more tutorials on connecting via MQTT, STOMP, and other topics around AMQ.Last updated: January 22, 2021