Manually configure ActiveMQ

Docker is the prefered way of running ActiveMQ, but if you need to do it manually, here’s how. This was valid at the end of 2019. If you are reading this in the future, it ma no longer be valid.

Table of contents

  1. ActiveMQ Server
  2. ActiveMQ Client
    1. Environment
    2. JNDI Properties

Active MQ is built in Java so it requires keystores and truststores in JKS format.

Documentation to configure ActiveMQ over TLS is quite sparse and not easy to determine what is required. This is mostly because you need to configure a listener URL in ActiveMQ and a connection URL in the client software. These appear similar but do not share configuration options. Sometimes it is not clear which options go in which URL.

Ultimately the configuration is quite simple, as explained below:

ActiveMQ Server

Edit ${AMQ_HOME}/conf/activemq.xml with the additional sslContext and transportConnector options:

    The sslContext can be used to configure broker-specific SSL properties.
    For more information, see:
    The transport connectors expose ActiveMQ over a given protocol to
    clients and other brokers. For more information, see:
    <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
    <transportConnector name="openwire" uri="tcp://;wireFormat.maxFrameSize=104857600"/>
    <transportConnector name="ssl" uri="ssl://;wireFormat.maxFrameSize=104857600&amp;transport.enabledCipherSuites=TLS_RSA_WITH_AES_256_CBC_SHA256"/>

ActiveMQ Client

The client software needs a truststore that contains the ActiveMQ public certificate.


One way to add the truststore to your client software is through Java properties:"

JNDI Properties

Connection to ActiveMQ can be done through JNDI Properties:

java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQSslInitialContextFactory
java.naming.provider.url = tcp://${HOST}:${PORT}?socket.verifyHostName=false
connectionFactoryNames = connectionFactory

Queues can be dynamic such as dynamicQueues/${UUIDv4} or staticly defined in JNDI.