![ActiveMQ logo](../images/activemq-logo.png)
Apache ActiveMQ Artemis Examples
Apache ActiveMQ Artemis comes with over 90 runnable examples. These can be found in the examples directory in the root of the distribution folder. There are examples covering JMS as well as all the protocols and functionality that Apache ActiveMQ Artemis supports.
Each example has its own instructions as to how they can be run, but for most of them it is as simple as running
mvn verify -Pexample
from the example directory. This will start a broker with the correct configuration, run the
example and then stop the broker. You'll need to ensure there is not a broker already running as this may conflict
with the broker that is configured and used in the example.
If you want to run an example against an already running broker then firstly you will need to start the broker using
the example configuration. An example configuration is provided which by default to run the queue example, to run this
use the command ./activemq run --config xml:../config/examples/bootstrap.xml
.
Once the server has started run the example with the command mvn -DskipBrokerStart verify -Pexample
. If you want
to run a different example simply edit the config/examples/bootstrap.xml
aand change the paths to point
the correct configuration (this will be found in the directory of the example you wish to run). By default the broker
will use the data/server0
directory for the journal, to avoid problems it is best to delete this
directory between running different examples or set the ARTEMIS_DATA_DIR
environment property in
activemq.conf
to use a different location