此内容没有您所选择的语言版本。
22.11. Configuring the HornetQ JCA Adapter for Remote Connections
Procedure 22.11. Configure an RA adapter to connect to two remote JBoss EAP instances
Before configuring the HornetQ RA to connect to remote EAP instance, we must create two connectors that point to remote JBoss EAP instances:
- Create outbound socket bindings:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create two netty connectors:
<netty-connector name="netty-remote-node-a" socket-binding="remote-jms-server-a"/> <netty-connector name="netty-remote-node-b" socket-binding="remote-jms-server-a"/>
<netty-connector name="netty-remote-node-a" socket-binding="remote-jms-server-a"/> <netty-connector name="netty-remote-node-b" socket-binding="remote-jms-server-a"/>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the RA configuration using the two netty connectors:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Annotate the MDB to use the resource adapter using the @ResourceAdapter annotation:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Run the following CLI commands to enable property substitution in order to use properties in deployment descriptors:
/subsystem=ee:write-attribute(name=jboss-descriptor-property-replacement,value=true) /subsystem=ee:write-attribute(name=spec-descriptor-property-replacement,value=true) /subsystem=ee:write-attribute(name=annotation-property-replacement,value=true)
/subsystem=ee:write-attribute(name=jboss-descriptor-property-replacement,value=true) /subsystem=ee:write-attribute(name=spec-descriptor-property-replacement,value=true) /subsystem=ee:write-attribute(name=annotation-property-replacement,value=true)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create an external context to find the remote destinations in order to send message from the MDB:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The MDB code would look like:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - You must remember that the hornetq RA module contains remoting-naming dependency for the MDB code given above to work:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - You must also add org.hornetq to global modules so the JMS API is visible to the application:
<global-modules> <module name="org.jboss.common-core" slot="main"/> <module name="org.hornetq" slot="main"/> </global-modules>
<global-modules> <module name="org.jboss.common-core" slot="main"/> <module name="org.hornetq" slot="main"/> </global-modules>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow