Enterprise class software for the rest of us! Run Apache ActiveMQ Broker as a WAR deployment in Tomcat and reduce the number of processes you need to start up.
Build project with a simple Maven command from the root folder:
mvn clean install
Two artifact will be generated:
- activemq-core-
{version}
.jar - a core jar with a Broker Web Bridge abstraction - activemq-webapp-
{version}
.war - a Web Application to run an ActiveMQ Broker
{version}
is equal to the version of ActiveMQ (plus -SNAPSHOT in case of snapshot builds).
Released version of the activemq-core module is available in the Maven Central Repository. Just add this artifact to your project:
<dependency>
<groupId>com.hevelian.activemq</groupId>
<artifactId>activemq-core</artifactId>
<version>5.14.5</version>
</dependency>
However if you want to use the last snapshot version, you have to add the Sonatype OSS repository:
<repository>
<id>sonatype-oss-snapshot</id>
<name>Sonatype OSS repository for snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
activemq-webapp is not deployed to a Nexus repository.
Just deploy activemq-webapp-{version}
.war to Tomcat and this is it. The application provides an advanced mechanism for configuration customizations, so if something is missing - find instructions below for any extensions. For the most complex cases - activemq-core-{version}
.jar provides an abstraction to build your own web application with custom broker initialization logic.
The Web Application just starts the ActiveMQ Broker. It does not start any UI to interact with the queues. This is planned for the next releases, but for now any third party tools can be used.
In case the war is deployed and no any additional configuration is specified - the default one will be used:
Property | Description | Value |
---|---|---|
activemq.data | Location of ActiveMQ data folder | ${user.home}/hevelian/activemq/data |
activemq.broker.name | ActiveMQ Broker name | Hevelian |
activemq.broker.useJmx | Use JMX connector | true |
activemq.broker.jmx.port | JMX connector port. Only if JMX connector is ennabled | 1099 |
activemq.broker.tcp.port | TCP connector port | 61616 |
Default properties can be overwritten in multiple ways:
- ServletContext init parameters (that is, web.xml context-param entries)
- JNDI properties
- System properties
- Environment variables
The overwrite order is the same as defined.
Specify custom properties in a separate configuration properties file. This approach is native since we have a single properties file for all Hevelian products for centralized configuration. The path to the configuration file can be defined through the property: hevelian.config.path
same way as any other properties (see the previous section for details).
This kind of configuration requires a basic knowledge of Spring and Schema based configuration. The idea is to overwrite a default Broker bean configuration file from the classpath with your own one. To specify a different file - set an activemq.conf.brokerURI
property to point to your own xml with bean config.
For example:
-Dactivemq.conf.brokerURI=xbean:file:///Users/myuser/activemq/conf/activemq.xml
More info at http://activemq.apache.org/xml-configuration.html
To change the default logging configuration - set the custom Log4J config file location. E.g.
-Dlog4j.configuration=file:///Users/myuser/activemq/logging/log4j.properties