Running the application on EAP6 it will use the hornetQ libraries in order to communicate over JMS to the new artemis broker running on EAP7. The artemis broker is backwards compatible.
1. Download the items
All available at the Red Hat developers portal:
2. Prepare the environment
We will be running EAP6 and EAP7 alongside each other, with the EAP6 instance running a port-offset.
- Download EAP6 and EAP7 and unzip
- Download the Fuse on EAP Installer (6.3) fuse-eap-installer-6.3.0.redhat-377.jar and extract into your JBOSS_EAP6_HOME.
- Install Fuse into the EAP6 by runnning
java -jar fuse-eap-installer-6.3.0.redhat-377.jar
After these steps you should have the following directory structure. Note that the Fuse installer has generated
fusepatch and some other items in the
3. Add users to each EAP instance
I like to add a standard management user to each EAP instance, and helps in this case because in our Fuse EAP instance we can log into the
I created the user
admin with the password of
password1! on each EAP instance.
4. Setup EAP7 JMS
Initially we must start EAP7 by running:
And in another terminal run:
The above has setup the connection factories, queue, and remote connector that the client will connect to. We have also exposed the
messaging-activemq mbeans to JMX, so we can inspect via the JConsole.
5. Setup EAP6
Run EAP6 - note we have a port offset to not conflict with EAP7.
This isn’t necessary, but potentially useful:
enable JMX statistics for hornetq (to prove we are not using the EAP6 queues)
6. Build and Deploy the EAP6 Application
The example I have used is the
camel-jms example bundled in with the
- Clone this repository:
git clone https://github.com/welshstew/wildfly-camel-jms-remote-example.git
mvn clean package
- Copy the artifact to JBOSSEAP6:
cp ./target/example-camel-jms-2.4.0.redhat-630377.war $JBOSS_EAP6_HOME/standalone/deployments
EAP6 should now deploy the application. The main changes compared to the original quickstart example are outlined below:
No ConnectionFactory @Resource injection lookup
HornetQRemoteConnectionFactory looked up via a new InitialContext
This is really where the magic is. We tell the application to use the
org.jboss.naming.remote.client.InitialContextFactory to lookup JNDI resources in the EAP7 instance - running locally on port 4447 (
remote://127.0.0.1:4447). Specifically we want the legacy-connection-factory
"jms/HornetQRemoteConnectionFactory" that we set up earlier on the EAP7 instance.
jboss-deployment-structure.xml used to bring in dependencies (remote naming and hornetq)
7. Examine the deployment/setup
Navigate to http://localhost:8180/hawtio/login and login with
Hawtio Console displaying routes from example application
Open yet another terminal and run
jconsole and connect to the EAP6 and EAP7 instances. Through this we should see camel running the in EAP6 application server, and the jms queues in the EAP7 server.
Queues in EAP7
Camel running in EAP6
In order to produce and consume messages we need to copy the XML files from the code to the
$ which is
cp wildfly-camel-jms-remote-example/camel-jms-remote/src/main/resources/*.xml $JBOSS_EAP6_HOME/standalone/data/orders
A simple web interface should also be available at http://localhost:8180/example-camel-jms/orders. Also Hawtio and the EAP7 JMX Console will confirm that jms messages are going via that server.
Deployed Application View
Logs will also confirm JMS activity:
The full standalone config of the EAP servers is available in the gist @ https://gist.github.com/welshstew/10a38171328d354c65757a7b2212fd44