Added: incubator/activemq/site/JBoss+Integration URL: http://svn.apache.org/viewcvs/incubator/activemq/site/JBoss%2BIntegration?rev=374430&view=auto ============================================================================== --- incubator/activemq/site/JBoss+Integration (added) +++ incubator/activemq/site/JBoss+Integration Thu Feb 2 08:31:10 2006 @@ -0,0 +1,265 @@ + + + + + + + + ActiveMQ - JBoss Integration + + + + + + + + + + + + + + + +
+ + + + + + +
+

Overview

+ +

Community

+ +

Using ActiveMQ

+ +

Features

+ +

Connectivitiy

+ +

Utilities

+ +

External Tools

+ +

Related Projects

+ +

Support

+ +

Developers

+ +

Tools we use

+ +

Feeds

+ + + + + + + + + +
+
+
+ Site +
+ + + News +
+
+ +
+ + + + + +
+ JBoss Integration + + +
+
+ + +
+
+

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:

+
    +
  • ActiveMQ version 3.1-M1 or later
  • +
  • JBoss 4.0.1-RC2 + + + + + + + + +
    +

    There was a bug in the Resource Adaptor which caused errors on deployment in JBoss 4.x. Instead use 3.1-M6 or the 3.1 release or later.

    +
    +
  • +
+

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-ra-$version.rar — This is the ActiveMQ Connector (JCA). It contains a standard ra.xml deployment descriptor and does not require any JBoss specific files to be added to it. This file does not require any changes before deploying it, so you simply copy it 'as-is' into the JBoss deployment directory. It has no deployment time dependencies.
  • +
  • panacya-jms-ds.xml — This is a JBoss data source file. It contains configuration information that JBoss uses to create connector specific objects used for outbound communication. These objects are then made available through JNDI. (JBoss uses this same mechanism for configuring JDBC data sources.) This file contains specific entries that tie it to the activemq-ra-1.2.rar file, so it has a deployment time dependency on that file.
  • +
  • panacya-mdb-test-1.0.jar — This is a standard EJB archive deployed as a standalone module. It contains the standard ejb-jar.xml deployment descriptor plus an additional JBoss specific deployment descriptor. The JBoss specific file is named jboss.xml and is located in the /META-INF directory. The jboss.xml file contains all of the configuration information needed by JBoss to connect both the inbound and the outbound flows to ActiveMQ. It contains information that ties the ejb-jar.xml file it to both the panacya-jms-ds.xml file and the activemq-ra-1.2.rar file, so it has a deployment time dependency on both of those files.
  • +
+

ActiveMQ 4.x

+
    +
  • You may need to to place the xbean-spring-<version> jar file to the server\defaul\deploy\lib directory
  • +
+

Examples

+

Here are some specific examples to help:

+ +
+
+ +   +