Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to configure ActiveMQ resource adapter #381

Closed
lucasweb78 opened this issue Mar 7, 2015 · 3 comments
Closed

Unable to configure ActiveMQ resource adapter #381

lucasweb78 opened this issue Mar 7, 2015 · 3 comments
Assignees
Labels
Milestone

Comments

@lucasweb78
Copy link

Wildfly Version: 8.2.0.Final
Wildfly-Camel Version: 2.1.0

I am attempting to configure a resource adapter for ActiveMQ as per the recommendation in the Wildfly-Camel documentation

For Wildfly / EAP container managed connection pools and XA-Transaction support, the ActiveMQ Resource Adapter can be configured into the container configuration file.

Below is the configuration I have used as per https://developer.jboss.org/wiki/HowToUseOutOfProcessActiveMQWithWildFly

<subsystem xmlns="urn:jboss:domain:resource-adapters:2.0">
    <resource-adapters>
        <resource-adapter id="activemq-rar">
            <module id="org.apache.activemq"/>
            <transaction-support>XATransaction</transaction-support>
            <config-property name="UseInboundSession">false</config-property>
            <config-property name="ServerUrl">tcp://localhost:61616?jms.rmIdFromConnectionId=true</config-property>
            <connection-definitions>
                <connection-definition class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory" jndi-name="java:/AMQConnectionFactory" enabled="true" pool-name="ConnectionFactory">
                    <xa-pool>
                        <min-pool-size>1</min-pool-size>
                        <max-pool-size>20</max-pool-size>
                        <prefill>false</prefill>
                        <is-same-rm-override>false</is-same-rm-override>
                    </xa-pool>
                </connection-definition>
            </connection-definitions>
        </resource-adapter>
    </resource-adapters>
</subsystem>

I currently get the following error:

13:44:32,048 ERROR [org.jboss.as.controller.management-operation](ServerService Thread Pool -- 47) JBAS014613: Operation ("add") failed - address: ([
("subsystem" => "resource-adapters"),
("resource-adapter" => "activemq-rar")
]) - failure description: "JBAS010473: Failed to load module for RA [org.apache.activemq]"

I believe this may be caused by the active-mq module bundling the unexploded RAR file instead of an exploded RAR file.

@jamesnetherton
Copy link
Collaborator

I think we can load the RA without exploding the entire archive. Thanks for identifying that the documentation needs improving in this area.

As a workaround for the current release you could try this:

  1. From a terminal session, change into your WildFly installation root directory

  2. Change into the ActiveMQ module directory.

cd modules/system/layers/fuse/org/apache/activemq/main
  1. Extract broker-config and ra.xml files from the resource adapter.
unzip activemq-rar-5.10.0.rar broker-config.xml
unzip activemq-rar-5.10.0.rar META-INF/ra.xml
  1. Modify module.xml so that it looks like the following.
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.apache.activemq">
  <resources>
    <resource-root path="." />
    <resource-root path="activemq-broker-5.10.0.jar" />
    <resource-root path="activemq-client-5.10.0.jar" />
    <resource-root path="activemq-jms-pool-5.10.0.jar" />
    <resource-root path="activemq-kahadb-store-5.10.0.jar" />
    <resource-root path="activemq-openwire-legacy-5.10.0.jar" />
    <resource-root path="activemq-pool-5.10.0.jar" />
    <resource-root path="activemq-protobuf-1.1.jar" />
    <resource-root path="activemq-ra-5.10.0.jar" />
    <resource-root path="activemq-rar-5.10.0.rar" />
    <resource-root path="activemq-spring-5.10.0.jar" />
  </resources>
  <dependencies>
    <module name="javax.api" />
    <module name="javax.jms.api" export="true" />
    <module name="javax.management.j2ee.api" export="true" />
    <module name="javax.resource.api" export="true" />
    <module name="javax.transaction.api" export="true" />
    <module name="org.apache.commons.pool" />
    <module name="org.apache.log4j" />
    <module name="org.apache.xbean.spring" />
    <module name="org.apache.camel.component.mqtt" />
    <module name="org.slf4j" />
    <module name="org.springframework.context" />
    <module name="org.springframework.core" />
  </dependencies>
</module>

You can modify META-INF/ra.xml and broker-config.xml for your requirements. This should be enough to load the RA.

@lucasweb78
Copy link
Author

@jamesnetherton thanks for providing the work around. It solved the problem and am now able to configure a resource adapter using the wildfly-camel active-mq module.

@tdiesler tdiesler modified the milestone: 2.2.0 Mar 13, 2015
@jamesnetherton
Copy link
Collaborator

Closing - Documentation updated to explain this in more detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants