ActiveMQ with JBoss 7.2.0.Alpha1 / EAP 6.1.0.Alpha1

Update 26.8.2013:

Described steps also work with Wildfly Alpha 4. Tested the described configuration with urn:jboss:domain:resource-adapters:1.1 + mdb part in the standalone.xml and the latest rar.


Working with an external ActiveMQ broker has become quite easy since my last attempts in the beginning of JBoss AS7. Here a short howto how to get it running in a few minutes – most of the steps are the same as already described under my former posting:

  1. Downloaded the latest release of the activemq.rar (.rar is – as .jar – a simple .zip file)
  2. Unzip the file and name the resulting folder activemq.rar
  3. Place this folder in the deployments directory of your JBoss AS
  4. Download ironjacamar.xml and place it into the META-INF folder of the activemq.rar folder
  5. Customize the existing ra.xml file if you don’t run activemq with default configuration on the same host
  6. Customize the ironjacamar.xml file as needed as queues and topics are configured here
  7. Edit the standalone.xml and add the following under urn:jboss:domain:ejb3:1.4. This change requires a restart (you could use the cli, I think…):
      <resource-adapter-ref resource-adapter-name="activemq.rar" />
      <bean-instance-pool-ref pool-name="mdb-strict-max-pool" />
  8. Create an empty file called activemq.rar.dodeploy

After these steps you should be able to deploy an application using MDB connected to ActiveMQ:

 * 2013 (c)

import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.jms.Message;
import javax.jms.MessageListener;

import org.jboss.logging.Logger;

 * Class RemoteActiveMqListener demonstrating mdb with activemq.
 * @author manuel
@MessageDriven(activationConfig = {
		@ActivationConfigProperty(propertyName = "destinationType",
				propertyValue = "javax.jms.Queue"),
		@ActivationConfigProperty(propertyName = "destination",
				propertyValue = "activemq/queue/TestQueue") })
public class RemoteActiveMqListener implements MessageListener {

	private static final Logger LOG = Logger

	 * (non-Javadoc)
	 * @see javax.jms.MessageListener#onMessage(javax.jms.Message)
	public void onMessage(final Message msg) {
		LOG.debugf("received message: %s", msg);




instead of extracting the .rar file and customizing it, you can also configure the ressource  adapter in your standalone.xml file. To get the same configuration as before without any modification of the .rar file, simply add the following under urn:jboss:domain:resource-adapters:1.1 and deploy the original .rar file named activemq.rar:

	<resource-adapter id="activemq.rar">
		<config-property name="UseInboundSession">
		<config-property name="Password">
		<config-property name="UserName">
		<config-property name="ServerUrl">
				jndi-name="java:jboss/exported/ConnectionFactory" enabled="true"
				use-java-context="true" pool-name="ConnectionFactory" />
			<admin-object class-name="org.apache.activemq.command.ActiveMQQueue"
				jndi-name="java:jboss/activemq/queue/TestQueue" use-java-context="true"
				<config-property name="PhysicalName">
			<admin-object class-name="org.apache.activemq.command.ActiveMQTopic"
				jndi-name="java:jboss/activemq/topic/TestTopic" use-java-context="true"
				<config-property name="PhysicalName">

Leave a Comment