The 3.x binary distribution of ActiveMQ comes with a script called 'activemq' which allows you to run a broker. Typing the following will run an ActiveMQ Broker using the out of the box configuration

You can use the Xml Configuration to customize the Message Broker to suit your needs. You can run a broker with a specific XML configuration as

Running the broker inside a Servlet Engine

If you have the binary distribution (3.1 onwards) you can run the broker using a WAR distribution. From the binary download type the following

and you get a war in the target directory capable of being deployed in a servlet engine. This has been tried in Resin, Tomcat 4.x, 5.x, Jetty 5.x and should work in most good servlet engines. See the Ant build for details and web.xml of how this works if you wish to integrate this into your WAR.

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 deploy the activemq-*.rar which is included in the binary distribution as a deployment unit in your app server.

Running the 3.x broker from the source code

You can do this by running the main() in the class inside your IDE, assuming you've set up your classpath properly.

Another option, if you have a source distribution, is to run the broker from inside Maven by typing

You can specify a URL to listen on by specifying a parameter, such as

Or via Maven

Using the XML configuration

You can use the Xml Configuration to customize the Message Broker to suit your needs. You can run a broker from Maven as follows...

If your classpath is setup correctly you can achieve the same thing from the command line

Notice that we supply an alternative Main which is dependent on Spring and takes an XML configuration file as the argument.

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 3.x to

© 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