EAP 6.4 & A-MQ discovery fabric connectivity

Latest response

I'm using EAP 6.4 and deployed activemq-amqp-5.11.0.redhat-620133 rar file to connect to JBoss A-MQ via "discovery:(fabric:default)" with Switchyard project. Below is the exception thrown while sending message to queue.

Caused by: java.io.IOException: Could not find factory class for resource: META-INF/services/org/apache/activemq/transport/discoveryagent/fabric at org.apache.activemq.util.FactoryFinder$StandaloneObjectFactory.loadProperties(FactoryFinder.java:96) at org.apache.activemq.util.FactoryFinder$StandaloneObjectFactory.create(FactoryFinder.java:58) at org.apache.activemq.util.FactoryFinder.newInstance(FactoryFinder.java:146) at org.apache.activemq.transport.discovery.DiscoveryAgentFactory.findDiscoveryAgentFactory(DiscoveryAgentFactory.java:45)

I'm using Jboss switchyard project and please find below the resource adapter binding:
<jca:binding.jca></jca:outboundConnection<jca‌​:processor type="org.switchyard.component.jca.processor.JMSProcessor"></jca:binding.jca>

Standalone-full.xml config as class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory"

Could you clarify whether discovery with fabric connectivity is container specific (works in JBoss Fuse - karaf and may not be in JBoss EAP 6.4?)

Responses

Hi Sreedhar,

Fabric discovery also works with JBoss EAP 6.4, but it requires some more work. You need to create a module instead deploying the RAR and add some libraries to it to enable fabric discovery.

As a start you can use this module.xml (which should be placed at JBOSS_HOME/modules/system/layers/base/org/apache/activemq/5.11.0

<resources>
    <resource-root path="."/>
    <resource-root path="activemq-spring-5.11.1.jar"/>
    <resource-root path="activemq-ra-5.11.1.jar"/>
    <resource-root path="activemq-protobuf-1.1.jar"/>
    <resource-root path="activemq-pool-5.11.1.jar"/>
    <resource-root path="activemq-openwire-legacy-5.11.1.jar"/>
    <resource-root path="activemq-kahadb-store-5.11.1.jar"/>
    <resource-root path="activemq-jms-pool-5.11.1.jar"/>
    <resource-root path="activemq-client-5.11.1.jar"/>
    <resource-root path="activemq-broker-5.11.1.jar"/>
    <resource-root path="activemq-mqtt-5.11.1.jar"/>
    <resource-root path="activemq-amqp-5.11.1.jar"/>
    <resource-root path="xbean-spring-3.18.jar"/>
    <resource-root path="spring-expression-3.2.11.RELEASE.jar"/>
    <resource-root path="spring-core-3.2.11.RELEASE.jar"/>
    <resource-root path="spring-context-3.2.11.RELEASE.jar"/>
    <resource-root path="spring-beans-3.2.11.RELEASE.jar"/>
    <resource-root path="spring-aop-3.2.11.RELEASE.jar"/>
    <resource-root path="commons-net-3.3.jar"/>
    <resource-root path="aopalliance-1.0.jar"/>
    <resource-root path="hawtbuf-1.11.jar"/>
    <resource-root path="proton-jms-0.8.jar"/>
    <resource-root path="proton-j-0.8.jar"/>
    <resource-root path="mqtt-client-1.10.jar"/>
    <resource-root path="hawtdispatch-transport-1.21.jar"/>
    <resource-root path="hawtdispatch-1.21.jar"/>
</resources>

<dependencies>
    <module name="org.slf4j"/>
    <module name="org.apache.log4j"/>
    <module name="org.apache.commons.pool"/>
    <module name="org.apache.commons.logging"/>
    <module name="javax.management.j2ee.api"/>
    <module name="javax.api"/>
    <module name="javax.resource.api"/>
    <module name="javax.validation.api"/>
    <module name="org.jboss.ironjacamar.impl"/>
    <module name="javax.jms.api" />
</dependencies>

You need to update the library versions as this was for the community version of ActiveMQ 5.1.11. Also make sure that in the module under META-INF you place the ra.xml file.

Then in standalone-full.xml you can reference the module like this:



...

I will elaborate on this a bit later, so stay tuned.

Thank you, Jochen Cordes. Please elaborate.