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
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.
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.
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
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.
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