This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Child pages
  • Run Broker
Skip to end of metadata
Go to start of metadata

Running an ActiveMQ Broker

Note if you want to use an embedded broker then see How do I embed a Broker inside a Connection

This page describes how to run a broker using 4.x or later of ActiveMQ.

Running the broker as a Unix Service

Running the broker using the Java Service Wrapper Implementation

See the Java Service Wrapper Page for details.

Monitoring the broker

You can monitor ActiveMQ using the Web Console by pointing your browser at

http://localhost:8161/admin

From ActiveMQ 5.8 onwards the web apps is secured out of the box.
The default username and password is admin/admin. You can configure this in the conf/jetty-real.properties file.

Or you can use the JMX support to view the running state of ActiveMQ.

For more information see the file docs/WebConsole-README.txt in the distribution.

Running the broker inside a Servlet Engine

See the source code (or WAR) of the Web Console for an example of how to run the broker inside a web application using Spring.

Running the broker inside your J2EE 1.4 Application Server

Whether its Apache Geronmio, JBoss 4, WebLogic 9 or some other J2EE 1.4 container you should be able to just reconfigure and then deploy the activemq-*.rar which is included in the binary distribution as a deployment unit in your app server. By default the rar is not configured to start an embedded broker. But by setting the brokerXmlConfig on the resource adapter configuration, the resource adapter will start an embedded broker.

For more details see J2EE

Running the broker from the source code

From the latest checkout of the code you can run a broker using the ActiveMQ Performance Plugin

Running the broker from maven

You can download and install the ActiveMQ Startup Maven Plugin via the following command if you are in a directory with a pom.xml. More detailed usage here

mvn org.apache.activemq.tooling:maven-activemq-plugin:5.0-SNAPSHOT:run

You can also include it the pom and run it using:

mvn activemq:run

Handling JMS brokers going down

A common requirement is that if the JMS broker goes down you want to automatically detect the failure and try to reconnect under the covers so that your application does not have to worry about reconnection.

There is detailed documentation on this in Configuring Transports; briefly...

Just change your connection URI in 4.x to

failover:tcp://host:port

And the JMS client will auto-reconnect to the broker if it is shutdown and restarted later on.

  • No labels

4 Comments

  1. Running a broker with a specific XML configuration command should contain "file" after xbean: (e.g "activemq xbean:file:foo.xml").

    • Using the XML configuration -

    1. Should mention that "maven server" should be executed in assembly directory.
    2. Bug: default.xml is in AMQ3.x format (see jira issue https://jira.logicblaze.com/jira/browse/AMQ-504)
    3. Package of Main class should be org.apache.activemq.spring.Main

    • Correction -

    The Main class is now located in org.apache.activemq.broker.Main.

  2. Unknown User (bmadigan)

    Is this document out of date for 4.x snapshot? None of the following seem to work in assembly,activemq-core, or anywhere else. 

     maven run:broker

     The plugin 'org.apache.maven.plugins:maven-run-plugin' does not exist or no valid version could be found 

    maven server

    [INFO] Invalid task 'server':