Why integrate activemq with jboss




















To configure the module we need to edit the JBoss configuration file, for this I started with standalone-full.

We need to add the activeMQ resource adapter, which we do by changing the line. This creates a resource adapter that uses the org. The next step is to configure the bridge and the local queue. We edit the hornetq subsystem to add a JMS bridge after the definition of the hornetQ server. This is mapped by our resource adapter to the remote ActiveMQ queue. This queue has two JNDI names, to allow it to be accessed both internally by the bridge and externally by our client.

Published at DZone with permission of Matt Brasier. See the original article here. Integration Zone. Thanks for visiting DZone today,. Edit Profile. Sign Out View Profile. Over 2 million developers have joined DZone. Like 1. Join the DZone community and get the full member experience. Join For Free. Once it is shut down, proceed to the next step.

As of the writing of this article, the latest released version is 4. Upon downloading this archive, expand it in a place where it can create a directory, preferably in the same location where JBoss was expanded. This is simply a table of contents of the RAR file.

There should only be one reason that this will fail - an incomplete download of the ActiveMQ tarball or zip file. Beyond that, depending on the version you download, some of the library versions may be slightly different. Below are the commands to achieve this task:. This is due to the flexibility it affords during the development phase for the configuration to be changed very easily.

The alternative is to JAR up the directory as a RAR file once the configuration is solid enough that it no longer needs to be changed. But leaving everything in a directory during development is the easiest path. Remember that you should be sitting in the following directory:. Resource adapters are often referred to as J2EE connectors and are very similar to the concept of a device driver for, say, a printer in that they contain information specific to connecting to a particular system.

The difference with JCA is that that connection has been formalized in specification for Java. JCA 1. In version 1. A resource adapter can support these four new contracts by implementing the required interfaces defined in the specification for each contract. By default, the in-VM protocol is commented out in favor of the tcp protocol. This will find ActiveMQ running on any interface on the localhost on port Below is an example of this:. Below is an example of how this should be changed:.

In this case, the broker-config. Save the changes to that file and then open the broker-config. The broker-config. This is the file used to configure ActiveMQ. The default contents of this file are usable, but should be customized to suit your environment.

There are several items of note about this configuration. The first change to this file is to add the brokerName attribute to the broker element and provide a name:. First this needs to be enabled:.

The default configuration is to use the ActiveMQ multicast transport for both. The configuration above is only enough to just get ActiveMQ up and running, nothing more.

Now we just need to start up JBoss to assure that it comes up correctly without error using the same commands we used previously to start JBoss:.

Also defined in this file are some s which are used to specify a topic and a queue. This file should be dropped into the JBoss deploy directory. Speaking of which, once this file is in place, a quick smoke test can be performed by simply starting up the JBoss server. Below is an example of the output that should be seen:. These are good indications that the configuration is correct, but needs to be verified a bit further. This is covered in the next section.

The seventh and final step is to perform a slightly more comprehensive smoke test of the integration. This can be accomplished using Apache Ant via the examples that come with the ActiveMQ binary distribution. An Ant build. The producer will be used to send messages that are received by the consumer.

To proceed with this testing, just follow the steps below:. Step 1 above just starts up JBoss. Step 2 above starts up a simple message consumer that comes with ActiveMQ.



0コメント

  • 1000 / 1000