ActiveMQ is a cross platform open source messaging server that supports a variety of languages and protocols. It includes support for AMQP 1.0. Some work on node-qpid required a local server for testing and debugging, thus ActiveMQ.

ActiveMQ is quite powerful, but for my needs the docs to simply getting it setup, configured, and running were a bit convoluted. Below are simple steps to getting ActiveMQ installed, configured, and running as an AMQP 1.0 server.


ActiveMQ requires Java to be installed. The OpenJDK will work fine and is often less hassle to install than the official Oracle release. ActiveMQ requires Java 6 or higher. I went with Java 8.

amqpid: gonzo$ sudo apt-get install openjdk-8-jdk

Ubuntu and other Linux distributions typically have a version of ActiveMQ available as a package. However, they are often older than what is available on the ActiveMQ site. To retrieve the binary release of 5.10.0:

amqpid: gonzo$ wget

Determine the actual link from the ActiveMQ download page.

I’ve installed ActiveMQ into /usr/local as follows:

amqpid: gonzo$ tar -zxvf apache-activemq-5.10.0-bin.tar.gz
amqpid: gonzo$ sudo mv apache-activemq-5.10.0 /usr/local/
amqpid: gonzo$ sudo ln -s /usr/local/apache-activemq-5.10.0 /usr/local/activemq


ActiveMQ can run with a default configuration, or you can set up an initial configuration in either /etc/default or /home/gonzo. If you don’t set up a configuration, you will constantly be prompted with the following message:

INFO: Using default configuration
(you can configure options in one of these file: /etc/default/activemq /home/gonzo/.activemqrc)

INFO: Invoke the following command to create a configuration file
/usr/local/activemq/bin/activemq setup [ /etc/default/activemq | /home/gonzo/.activemqrc ]

So, create the configuration as follows:

amqpid: gonzo$ sudo /usr/local/activemq/bin/activemq setup /etc/default/activemq

INFO: Creating configuration file: /etc/default/activemq
INFO: It's recommend to limit access to '/etc/default/activemq' to the priviledged user
INFO: (recommended: chown 'root':nogroup '/etc/default/activemq'; chmod 600 '/etc/default/activemq')

With ActiveMQ, you can use the default configuration files in ACTIVEMQ_HOME/conf or you can set up your own configuration. The command line tool adds a utility to help with this. For this tutorial, I will assume that configuration will live in /home/gonzo/sys/activemq. To create that configuration:

amqpid: gonzo$ /usr/local/activemq/bin/activemq create /home/gonzo/sys/activemq/amqptest

This will create the necessary configuration files (as well as a shortcut script) under the directory /home/gonzo/sys/activemq/amqptest..

For my purposes, I only want the AMQP protocol running. By default, several others are configured. In order to limit the allowed protocols/open ports, open the file /home/gonzo/sys/activemq/amqptest in an editor. Look for a section resembling:

    <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
    <transportConnector name="openwire" uri="tcp://;wireFormat.maxFrameSize=104857600"/>
    <transportConnector name="amqp" uri="amqp://;wireFormat.maxFrameSize=104857600"/>
    <transportConnector name="stomp" uri="stomp://;wireFormat.maxFrameSize=104857600"/>
    <transportConnector name="mqtt" uri="mqtt://;wireFormat.maxFrameSize=104857600"/>
    <transportConnector name="ws" uri="ws://;wireFormat.maxFrameSize=104857600"/>

And replace it with:

    <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
    <transportConnector name="amqp" uri="amqp://;wireFormat.maxFrameSize=104857600"/>

Save the file and exit the editor.

Running ActiveMQ

Now that ActiveMQ is installed and configured, you can run the configuration as follows:

amqpid: gonzo$ /home/gonzo/sys/activemq/amqptest/bin/amqptest start
INFO: Loading '/etc/default/activemq'
INFO: Using java '/usr/bin/java'
INFO: Starting - inspect logfiles specified in and to get details
INFO: pidfile created : '/home/gonzo/sys/activemq/amqptest/data/' (pid '10674')

To verify that ActiveMQ is running:

amqpid: gonzo$ /home/gonzo/sys/activemq/amqptest/bin/amqptest status
INFO: Loading '/etc/default/activemq'
INFO: Using java '/usr/bin/java'
ActiveMQ is running (pid '10674')

And to see it listening on a port (the default AMQP port is 5762):

amqpid: gonzo$ netstat -an | grep 5672
tcp6       0      0 :::5672                 :::*                    LISTEN