
By Yakov Fain | Article Rating: |
|
April 25, 2014 09:48 AM EDT | Reads: |
2,642 |

While testing the new JMS 2.0 API, I wanted to see an example of the remote client connecting to a messaging server. I decided to start with the HornetQ messaging server that’s embedded into JBoss Wildfly 8. Folks from JBoss sent me a link to the the GitHub project Wildfly/Quickstart with lots of Wildfly Java EE 7 examples. The HelloWorldJMSClient was the one I was looking for.
The readme file contains detailed instructions on how to compile and run the example. Seeing a requirement to have Maven 3.1 or better looks like an overkill for a helloworld type example. Installed Maven using homebrew – it gave me Maven 3.0.5. Does it mean that helloworld wouldn’t work? Yes it does, but not because of the old maven version. The pom.xml has references to old versions of Wildfly.
In two days I’ll be teaching a JMS class online. Sending students to the maven maze is not appealing to me. Here’s what I suggest. Follow the instructions from the Readme.md to start the Wildfly server, create a user, and a queue. But then, compile and run HelloWorldJMSClient by simply adding jboss-client.jar to the classpath – it has all required JNDI and JMS classes. For example, this is how you can do it from a Terminal window (or a Command Window):
java -cp “.:/Users/yfain11/wildfly-8.0.0.Final/bin/client/jboss-client.jar” org.jboss.as.quickstarts.jms.HelloWorldJMSClient
That’s all. Look ma, no Maven! I sent a GitHub pull request to the Wildfly folks to add this solution to their readme file.
If you like working in IntelliJ IDEA IDE, just add the jboss-client.jar as an external library to your module. If you are an Eclipse fan, go to Project Properties | Build Path and add the jboss-client.jar as an external jar.
A bit later I’m planning to do the same test against GlassFish/OpenMQ combo. I know that in the past they were suggesting using appclient for these purposes, but there should be a simpler way to do stuff.

Read the original blog entry...
Published April 25, 2014 Reads 2,642
Copyright © 2014 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Yakov Fain
Yakov Fain is a Java Champion and a co-founder of the IT consultancy Farata Systems and the product company SuranceBay. He wrote a thousand blogs (http://yakovfain.com) and several books about software development. Yakov authored and co-authored such books as "Angular 2 Development with TypeScript", "Java 24-Hour Trainer", and "Enterprise Web Development". His Twitter tag is @yfain
![]() Apr. 22, 2018 04:00 PM EDT Reads: 6,899 |
By Elizabeth White ![]() Apr. 22, 2018 03:00 PM EDT Reads: 13,120 |
By Pat Romanski Apr. 22, 2018 02:45 PM EDT Reads: 2,338 |
By Pat Romanski Apr. 22, 2018 02:30 PM EDT Reads: 1,377 |
By Liz McMillan Apr. 22, 2018 02:00 PM EDT Reads: 1,696 |
By Yeshim Deniz ![]() Apr. 22, 2018 12:45 PM EDT Reads: 1,990 |
By Elizabeth White Apr. 22, 2018 12:15 PM EDT Reads: 1,751 |
By Pat Romanski ![]() Apr. 22, 2018 12:00 PM EDT Reads: 5,431 |
By Elizabeth White ![]() Apr. 22, 2018 12:00 PM EDT Reads: 3,962 |
By Elizabeth White ![]() Apr. 22, 2018 10:45 AM EDT Reads: 6,844 |
By Yeshim Deniz Apr. 22, 2018 10:00 AM EDT Reads: 999 |
By Pat Romanski ![]() Apr. 22, 2018 09:45 AM EDT Reads: 8,662 |
By Pat Romanski Apr. 22, 2018 09:15 AM EDT Reads: 2,271 |
By Liz McMillan Apr. 22, 2018 09:00 AM EDT Reads: 2,622 |
By Elizabeth White ![]() Apr. 22, 2018 09:00 AM EDT Reads: 6,447 |
By Yeshim Deniz Apr. 22, 2018 09:00 AM EDT Reads: 2,726 |
By Yeshim Deniz Apr. 22, 2018 08:45 AM EDT Reads: 3,139 |
By Pat Romanski ![]() Apr. 22, 2018 08:30 AM EDT Reads: 8,808 |
By Pat Romanski ![]() Apr. 22, 2018 05:15 AM EDT Reads: 3,786 |
By Elizabeth White ![]() Apr. 22, 2018 04:00 AM EDT Reads: 17,315 |