Apache ActiveMQ

ActiveMQ Configuration

In this second tutorial about ActiveMQ we will learn its basic configuration.

The broker configuration is named activemq.xml and it's contained into the conf folder of your ActiveMQ installation. The most interesting part is the the Transport connectors which are used to expose ActiveMQ using a variety of protocols:

	<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"/>

So, for example if you want to reach ActiveMQ from a remote JMS client, you have to use the tcp:// channel.

Alternate startup configuration

If you don't want to change the default configuration, then you can apply startup settings to your Broker configuration URI as follows:

The URI is assumed to be a composite uri with multiple uris that are used to bind the connectors of the broker.


If a composite URI use the network: scheme, then the rest of the URI is bound as a network connector.

The following example starts up a broker accepting connections on port 41616, and establishes a network connection to mymachine:61616 and disables persistence.

C:\apache-activemq-5.10.0\bin>activemq.bat start broker:(tcp://localhost:41616,network:static:tcp://mymachine:61616)?persistent=false&useJmx=true

Another way to customize the startup of ActiveMQ is the Broker XBean URI. the Broker XBean URI runs a specifically configured broker by referencing an XML configuration file on the classpath or external URL. The following example starts up a broker using the activemq.xml configuration file which is in the current directory:

C:\apache-activemq-5.10.0\bin>activemq.bat start xbean:file:./activemq.xml

The default activemq.xml provides a sample format for a configuration file.

Follow us on Twitter