Using the ActiveMQ Resource Adapter, I recently integrated ActiveMQ with JBoss. The integration included both inbound and outbound messages. Inbound messages were handled by Message Driven Beans (MDBs) and outbound messages were published by an EJB Stateless Session Bean.

Since this turned out to be a non-trivial task, resulting in an absurd amount of hair loss for me, I figured I would share my new found knowledge with everyone else. Hopefully, someone else will find this useful.

Environment

You will need the following:

Overview

The above diagram shows the message flows and the structure of the test. A small JMS client (not shown), sitting outside of JBoss, generates a JMS TextMessage and places it on either the queue.testQueue or the topic.testTopic. These inbound messages are consumed by one or more of the MDBs which then invoke the SenderEJB. The SenderEJB takes the input from the MDBs and publishes a simple response message to the queue.outbound queue.

Nothing fancy but it does demonstrate a wide set of possible configurations.

Components deployed to JBoss

In order to integrate ActiveMQ with JBoss (for this test), three files need to be placed into the JBoss deployment directory. They are:

ActiveMQ 4.x

Examples

Here are some specific examples to help:

More on JBoss Integration

Integrating Apache ActiveMQ with JBoss