Using Hermes JMS with Java MQ in Java CAPS 6, OpenESB and GlassFishESB

It has been a while. I was busy. One of the things that kept me busy was putting together demonstrations for the CEC 2008 in Las Vegas, then delivering them. As an offshoot of that work I have a fair bit of material to share, which will take some time to put together into a form that can be posted in the blog.This piece is the first one.


Whereas Java CAPS 6 supports interaction with the Java MQ infrastructure through the Enterprise Manager, neither OpenESB nor GlassFishESB include the 'Enterprise' class functionality found in the Java CAPS 'classic', GUI for interaction with the JMS being one of example.


Here is a step-by-step on how to configure Hermes JMS (http://www.hermesjms.com/) for use with Java MQ, distributed as part of the OpenESB, GlassFishESB and Java CAPS 6. <- This link points to the original post.


The updated post, inclduing material frm the comments below, is available at http://mediacast.sun.com/users/Michael.Czapski-Sun/media/HermesJMS_Configuration_for_JavaMQ/details and should be used instead.

Comments:

Hi Michael, what are the advantages of HermesJMS over the built-in QBrowser utility?
http://blogs.sun.com/pblaha/entry/jms_message_browser
Jason

Posted by jason on November 19, 2008 at 06:50 PM EST #

Hello, Jason.

Having never worked with it I cannot comment. One thing, on superficial inspection, is that it seems to only address Java MQ, whereas Hermes JMS addresses any number of JMS implementations, including these from SeeBeyond and others.

Regards

Michael

Posted by Michael on November 19, 2008 at 11:23 PM EST #

Michael,

I have always been a big fan of your posts. I have been trying to get HermesJMS work with remote JMQ broker with not much of luck. Your example works well with default 7676 port. But from usefullness perspective, we can use emanager to achieve the same. Presently, there is no way to monitor remote brokers ( Emanager can not monitor more than 1 broker).

So my question is.. Do you have ideas on how to get this working for remote brokers (Not listening on port 7676).

Appreciate your response.

Thanks,
Rajan

Posted by Rajan Jain on November 20, 2008 at 04:01 AM EST #

Hello, Rajan.

Thanks for the good word :-)
Alas, this is the sticking point. I don't know how to configure HermesJMS to use a non-default port. Perhaps Java MQ client code uses a system property to figure out what port to use, that can be configured in HermesJMS. I have not spent the time looking. If you, or anyone else, figures it out - please share :-)

Regards

Michael

Posted by Michael Czapski on November 20, 2008 at 04:05 AM EST #

Hello, Rajan.

You provided the motivation I lacked - thanks :-)

In the HermesJMS {installation directory}/bin/hermes.bat (on WIndows or equivalent on Unix) there is a command that launches Hermes JMS applicatin class. Add a java system property like:

-DimqAddressList=mq://localhost:7677,mq://localhost:7676

somewhere amongst other system properties there once you configured Java MQ as per original post. Hermes JMS will try each server in turn to locate the queue/topic. I have not spend the time thinking how you are going to make it resolve queues/topics with the same names on different servers :-)

Example from by script looks like:

start "HermesJMS" "%JAVA_HOME%\\bin\\javaw" -XX:NewSize=256m -Xmx1024m -Dhermes.home="%HERMES_HOME%" %HERMES_OPTS% -Dlog4j.configuration="file:%HERMES_HOME%\\bin\\log4j.props" -DimqAddressList=mq://localhost:7677,mq://localhost:7676 -Dsun.java2d.noddraw=true -Dhermes="%HERMES_CONFIG%\\hermes-config.xml" -Dhermes.libs="%HERMES_LIBS%" hermes.browser.HermesBrowser

Regards

Michael

Posted by Michael Czapski on November 20, 2008 at 04:40 AM EST #

Hi Michael,

A number of people have been asking about HermesJMS/Open MQ on the MQ forum:

http://forums.sun.com/forum.jspa?forumID=711

and on users@mq.dev.java.net for a while now - thanX very much for your useful post.

I've just written up and placed a FAQ at:

http://wiki.glassfish.java.net/Wiki.jsp?page=OpenMQHermesJMSQuestions

which contains similar steps to yours plus some steps for configuring HermesJMS via JNDI. I'm currently also looking at creating an OpenMQ plugin for HermesJMS so that HermesJMS among other things can 'discover' the destinations on the MQ broker instead of the user having to know the destinations to browse; the above FAQ page will be updated when that work materializes.

With regards to connecting to a remote broker, I was only succesful by doing it via the JNDI way. I tried to add properties to the connection factory (eg {imqAddressList=mq://localhost:7677}) after selecting it on the Preferences dialog:

http://wiki.glassfish.java.net/attach/OpenMQHermesJMSQuestions/new_session_choose_cf.gif

but it didn't work. I'll keep looking... Let me know if you manage to get it to work other than using '-DimqAddressList=...' on the command line - I would like to get this to work so that I can connect to multiple remote brokers at the same time and browse/copy msgs to/from them.

regards,
-isa

Posted by Isa Hashim on November 27, 2008 at 01:38 AM EST #

Is there a web console available to manage queues/topic?

Posted by Pavneet on March 06, 2009 at 05:41 PM EST #

Not in Hermes JMS that I am aware of.
If you have Java CAPS 6 there is the Enterprise Manager that provides this functionality, amongst other things.

Regards

Michael

Posted by Michael Czapski on March 07, 2009 at 01:09 AM EST #

Hi Michael,
This post is quite helpful. I have tried setting up Hermes JMS for SeeBeyond JCAPS plugin. Everything worked as per the document at Hermes website. I am getting the JMSException: java.net.ConnectException: Connection refused: connect

The client is detecting the queues in the message server but fails to connect to queues.

Any suggestions or hint what is going wrong.

Regards
Srinivas Erukulla

Posted by Srinivas on August 31, 2009 at 10:09 PM EST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

In this Blog I post abstracts of articles / writeups / notes on various aspects of Java CAPS and SOA Suite including solutions, discussions and screencasts. The links to the referenced material are included in the bodies of the abstracts.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today