From version 5.4.0 onwards, ActiveMQ comes with a enhanced shell script for starting, stopping and managing the broker in Unix environment. For basic activemq and activemq-admin scripts functionality take a look at ActiveMQ Command Line Tools Reference.

This new activemq script incorporate these two scripts into one and adds some new functionalities. On top of regular activemq and activemq-admin scripts, it adds the following features:

  • start - starts the broker in background. It saves process id in the ${ACTIVEMQ_DATA_DIR}/activemq.pid for future reference. It accepts the same command line arguments like the original activemq script, so you can do something like
$ bin/activemq start xbean:conf/activemq-stomp.xml
  • console - starts the broker in foreground. It is basically the replacement for the old activemq script
  • stop - stops the broker that is running in the background. It tries first to stop the broker using shutdown task. If that task doesn't return in 30 seconds (configurable), it will kill the process.
  • restart - stops the running instance (if there's one) and starts the new one
  • status - checks if activemq process is running
  • setup - create the specified configuration file for this script. The configuration of the script can be placed at /etc/default/activemq or $HOME/.activemqrc.

To use addtional configurations for running multiple instances on the same operating system rename or symlink script to a name matching to activemq-instance-<INSTANCENAME>. This changes the configuration location to /etc/default/activemq-instance-<INSTANCENAME> and $HOME/.activemqrc-instance-<INSTANCENAME>. Configuration files in /etc have higher precedence.

© 2004-2011 The Apache Software Foundation.
Apache ActiveMQ, ActiveMQ, Apache, the Apache feather logo, and the Apache ActiveMQ project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram