Active MQ v 5.15.9 Config with Wildfly 10.1
----------------------------------------Do the Config on WildFly Server
1. cd /opt
2. sudo wget https://repository.apache.org/content/repositories/releases/org/apache/activemq/activemq-rar/5.14.3/activemq-rar-5.15.9.rar
3. cd /opt/wildfly/modules/system/layers/base/org/apache/activemq
4. mkdir main
5. sudo chown -R wildfly:wildfly main
6. cd main
7. sudo unzip /opt/activemq-rar-5.15.9.rar
8. sudo chown -R wildfly:wildfly .
9. sudo vi META-INF/ra.xml
<resourceadapter>
<resourceadapter-class>org.apache.activemq.ra.ActiveMQResourceAdapter</resourceadapter-class>
<config-property>
<description>
The URL to the ActiveMQ server that you want this connection to connect to. If using
an embedded broker, this value should be 'vm://localhost'.
</description>
<config-property-name>ServerUrl</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>tcp://1.2.3.4:61616</config-property-value>
<!-- <config-property-value>vm://localhost</config-property-value> -->
</config-property>
8. sudo vi broker-config.xml
<transportConnectors>
<transportConnector name="openwire" uri="tcp://1.2.3.4:61616"/>
</transportConnectors>
9. sudo vi module.xml [create new file]
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="org.apache.activemq">
<resources>
<resource-root path="." />
<resource-root path="activemq-broker-5.15.9.jar" />
<resource-root path="activemq-client-5.15.9.jar" />
<resource-root path="activemq-jms-pool-5.15.9.jar" />
<resource-root path="activemq-kahadb-store-5.15.9.jar" />
<resource-root path="activemq-openwire-legacy-5.15.9.jar" />
<resource-root path="activemq-pool-5.15.9.jar" />
<resource-root path="activemq-protobuf-1.1.jar" />
<resource-root path="activemq-ra-5.15.9.jar" />
<resource-root path="activemq-spring-5.15.9.jar" />
<resource-root path="guava-18.0.jar"/>
<resource-root path="commons-net-3.6.jar"/>
<resource-root path="commons-pool2-2.4.2.jar"/>
<resource-root path="commons-logging-1.2.jar"/>
<resource-root path="hawtbuf-1.11.jar"/>
<resource-root path="spring-aop-4.3.18.RELEASE.jar"/>
<resource-root path="spring-beans-4.3.18.RELEASE.jar"/>
<resource-root path="spring-context-4.3.18.RELEASE.jar"/>
<resource-root path="spring-core-4.3.18.RELEASE.jar"/>
<resource-root path="spring-expression-4.3.18.RELEASE.jar"/>
<resource-root path="xbean-spring-4.2.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="org.slf4j"/>
<module name="javax.resource.api" slot="main"/>
<module name="javax.jms.api" slot="main"/>
<module name="javax.management.j2ee.api" slot="main"/>
</dependencies>
</module>
10. sudo chown -R wildfly:wildfly module.xml
11. Add the following on standalone-full.xml under
- <subsystem xmlns="urn:jboss:domain:resource-adapters:4.0">
- <resource-adapters>
- <resource-adapter id="activemq-remote.rar">
- <module slot="main" id="org.apache.activemq"/>
- <transaction-support>XATransaction</transaction-support>
- <config-property name="ServerUrl">
- tcp://<hostname>:61616?jms.rmIdFromConnectionId=true
- </config-property>
- <config-property name="UserName">
- xxxxx
- </config-property>
- <config-property name="UseInboundSession">
- false
- </config-property>
- <config-property name="Password">
- xxxxx
- </config-property>
- <connection-definitions>
- <connection-definition class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory" jndi-name="java:/AMQConnectionFactory" enabled="true" pool-name="AMQConnectionFactory">
- <xa-pool>
- <min-pool-size>20</min-pool-size>
- <max-pool-size>50</max-pool-size>
- <prefill>false</prefill>
- <is-same-rm-override>false</is-same-rm-override>
- </xa-pool>
- </connection-definition>
- </connection-definitions>
- <admin-objects>
- <admin-object class-name="org.apache.activemq.command.ActiveMQTopic" jndi-name="java:jboss/activemq/topic/TestTopic" use-java-context="true" pool-name="TestTopic">
- <config-property name="PhysicalName">
- activemq/topic/TestTopic
- </config-property>
- </admin-object>
- <admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:jboss/activemq/queue/TestQueue" use-java-context="true" pool-name="TestQueue">
- <config-property name="PhysicalName">
- activemq/queue/TestQueue
- </config-property>
- </admin-object>
- <admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:jboss/activemq/queue/nswpf_hip_log_queue" pool-name="log_queue">
- <config-property name="PhysicalName">
- activemq/queue/log_queue
- </config-property>
- </admin-object>
- <admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:jboss/activemq/queue/nswpf_hip_error_queue" pool-name="error_queue">
- <config-property name="PhysicalName">
- activemq/queue/error_queue
- </config-property>
- </admin-object>
- </admin-objects>
- </resource-adapter>
- </resource-adapters>
- </subsystem>
- Change Below for ejb3
- ------------------------------
- <mdb>
- <resource-adapter-ref resource-adapter-name="${ejb.resource-adapter-name:activemq-remote.rar}"/>
- <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
- </mdb>
yum install zip unzip -y
ReplyDeletesudo jar xvf /opt/activemq-rar-5.14.3.rar
ReplyDelete