Apache TomEE is a distribution of Tomcat with fully integrated ActiveMQ offering full JMS support to plain war files, Servlets and more. No setup is required and code like the following will work out of the box.
All topics and queues are created automatically when declared properly in code as above. For example, the following reference in code:
Is identical to the following declaration in the <tomee.home>/conf/tomee.xml file or WEB-INF/resources.xml file:
In both situations Topic name would be 'foo'.
Configuring an Embedded Broker
If no broker is configured and JMS is used in the webapp, TomEE will create a broker equivalent to the following declaration:
This creates an ActiveMQ Broker that runs inside TomEE and is bound to the address
Connecting to an External Broker
It is possible to connect to an ActiveMQ Broker running externally. The setup is similar to the above with only two changes.