How to configure JBoss-EAP-6 to connect to an external JBoss-EAP HornetQ instance
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
Issue
- We are trying to configure JBoss-EAP-6 to communicate with external JBoss-EAP-6 server that is running in standalone mode. Could you please guide us how to achieve this ?
Resolution
You need to configure HornetQ's resource adapter to communicate to a remote HornetQ instance. Since JBoss-EAP-6 has embedded HornetQ's resource adapter in JBoss-EAP-6, you need to override the default "pooled connection factory" to achieve this.
Please configure a connector pointing to the remote HornetQ instance. Then use the configured connector in the pooled connection factory. Here's a sample configuration. The attributes are self explanatory.
<subsystem xmlns="urn:jboss:domain:messaging:1.3">
<hornetq-server>
<connectors>
<connector name="remote-server">
<factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
<param key="host" value="10.0.0.3"/> <!-- REMOTE LIVE SERVER IP ADDRESS -->
<param key="port" value="5445"/>
</connector>
</connectors>
<jms-connection-factories>
<pooled-connection-factory name="hornetq-ra">
<inbound-config>
<setup-attempts>200</setup-attempts>
<setup-interval>10000</setup-interval>
</inbound-config>
<retry-interval>1000</retry-interval>
<retry-interval-multiplier>2.0</retry-interval-multiplier>
<max-retry-interval>60000</max-retry-interval>
<reconnect-attempts>200</reconnect-attempts>
<user>admin</user> <!-- PLEASE CHANGE THIS -->
<password>password@?</password> <!-- PLEASE CHANGE THIS -->
<transaction mode="xa"/>
<connectors>
<connector-ref connector-name="remote-server"/>
</connectors>
<entries>
<entry name="java:/JmsXA"/>
</entries>
</pooled-connection-factory>
</jms-connection-factories>
</hornetq-server>
</subsystem>
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
