Two Laptop Bag*
The moose likes Other JSE/JEE APIs and the fly likes Can JMS + MQ work together? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Can JMS + MQ work together?" Watch "Can JMS + MQ work together?" New topic
Author

Can JMS + MQ work together?

Max Tomlinson
Ranch Hand

Joined: Jul 17, 2001
Posts: 365
Hi all-
I'm working with MA88 (IBM's release of JMS that uses MQ5.2) and I made the assumption that I could send a JMS message to a reciever that would read it using the older MQ 5.2 MQI (since MA88 is a type of JMS-MQ bridge). It seems that I am wrong, that the message includes a JMS header which screws up the receiver. Someone told me I can omit this header for such clients? Is this possible? Are JMS and MQ (under IBM) interoperable?
thansk,
Max Tomlinson
Matt Midcap
Sheriff

Joined: Jan 07, 1999
Posts: 440
Hi Max,
I'm going to move this to the "Other Java APIs" where hopefully you can get more responces on your question.
Matt


Best Regards,<br />Matt Midcap
Eric Stephens
Greenhorn

Joined: Jun 14, 2001
Posts: 11
Not claiming to be an expert on the topic or anything, but...
I tested this the other day connecting from a Windows machine over to a Queue on a z/OS box and and initial test seemed to work ok. Can you explain more about the header information? There is a setting that you need to put into LDAP to indicate that you are a JMS client.
------------------
Eric A. Stephens, SCJP
Software Architect, Mentor, & Instructor
ericastephens@mycingular.com


Eric A. Stephens<BR>Sun Certified Programmer for the Java? 2 Platform<BR>ericastephens@mycingular.com
Max Tomlinson
Ranch Hand

Joined: Jul 17, 2001
Posts: 365
Here's is what the MQ client on the other end is seeing:
The RFH stuff up to the "OGIM0100" is all JMS header.
BTW, this doesn't use LDAP.
thansk,
Max
RFH ...-...-..--..-.MQSTR ......-.... <mcd><Msd>jms_text</Msd></mcd>
...P<jms><Dst>queue:///GBS.IMSA.INPUT.QUEUE</Dst><Rto>queue:///GBS.QUEUE</Rt
o></jms>OGIM0100 OpenGBSTest
000 etc.
Swatantra Yadav
Greenhorn

Joined: Aug 29, 2000
Posts: 9
Max,
I am not sure this is an answer to your query. But I was able to run the JMS samples that IBM has provided using MQSeries 5.2.
My JMSAdmin.config file had following settings:
INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
PROVIDER_URL=file://C:/temp
SECURITY_AUTHENTICATION=none
PTPSample01 :
* This program connects to the default queue manager on the local machine
* using the MQ Classes for Java bindings. It then sends a message to the queue SYSTEM.DEFAULT.LOCAL.QUEUE and reads it back again.
It is sending a text messages and does not set any JMSHeaders or properties. for JNDI a file called .bindings is created when I ran the ivtSetUp.bat
But I must say that the MQSeries was not easy to install and way more difficult that using J22ee 1.3 JMS provider. I still havent figured it out. Specially its Queue Manager and Channel terrify me. I guess it is because it is a real world application and not a toy (;-
hope that helps.
-Swatantra
Max Tomlinson
Ranch Hand

Joined: Jul 17, 2001
Posts: 365
Thanks for the reply-
I think the mistake I made was in assuming that I could send using JMS and that the other side coudl receive using MQ. Both sides have to sue JSm in roder fot this to work, unless some kind of mapper is used.
Max Tomlinson
Ranch Hand

Joined: Jul 17, 2001
Posts: 365
Let's try that typo-free:
Thanks for the reply-
I think the mistake I made was in assuming that I could send using JMS and that the other side could receive using MQ. Both sides have to use JMS in order for this to work, unless some kind of mapper is used.
D Shetler
Greenhorn

Joined: Sep 27, 2002
Posts: 1
I am having this MQ JMS problem. Were you able to solve your problem?
Kev D'Arcy
Ranch Hand

Joined: Jul 26, 2001
Posts: 75
Are you using Pub/Sub or point-to-point?
Y.F
Greenhorn

Joined: Oct 03, 2002
Posts: 1
If one side of your application is JMS and the other is MQ application (i.e, MQ Java or MQ C++); in order for the MQ application to read the message JMS sent you need to configure the "TARGCLIENT" field in you JMS Queue or Topic to be "MQ".
For example
InitCtx> define q(TESTQ) TARGCLIENT(MQ)
JMS uses RFH2 headers, where MQ uses RFH1 headers. So if you sent the message from JMS application without specifying TARGCLIENT to be MQ the messgae will have RFH2 headers and MQ applications wouldn't know what to do with it.
Good luck
Bill Mc
Greenhorn

Joined: Sep 18, 2003
Posts: 1
use this parameter :
queue.setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);
and JMS will not use it's headers
Allan Huang
Greenhorn

Joined: Mar 10, 2004
Posts: 1
One other options is to use the following code in your JMS message sending application to create the queue.
testQueue = session.createQueue("queue://QueueManager/Queue?targetClient=1");
Then the message will be sen as MQSTR format.
We are using WebSphere MQ 5.3 and this works for us.
Cheers
Allan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can JMS + MQ work together?