Author |
Message
|
bamboozled_by_MQ |
Posted: Mon Sep 13, 2004 12:06 pm Post subject: process JMS message from non-JMS client |
|
|
Voyager
Joined: 07 Jan 2004 Posts: 75
|
I want to take a simple MQ message and build a JMS message with it. Does anyone know of any examples.
I want to be able to put a simple mq message on a queue (using MMC mq explorer) and have another program come grab it and make a JMS message with it.
sounds easy, but...
thank you! |
|
Back to top |
|
 |
bower5932 |
Posted: Mon Sep 13, 2004 12:17 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
All that you'll need to do is add an RFH2 header to the front of the message. If you browse a JMS message on the queue and look through chapter 12 of the Using Java manual, you should get the information that you need. There is a C program at:
http://www.developer.ibm.com/tech/sampmq.html
that builds an RFH2 header. It is called jsmqput.c (that is jsm not jms!). You might want to look at it. |
|
Back to top |
|
 |
bamboozled_by_MQ |
Posted: Tue Sep 14, 2004 5:16 am Post subject: |
|
|
Voyager
Joined: 07 Jan 2004 Posts: 75
|
so if I understand you correctly,
I can write a java program that reads a regular MQ message off a local queue, then add a MQRFH2 header and it becomes a JMS message that can be put on another queue to be picked up by a message driven bean? I'm not to good at C, so that example is a little confusing, does anyone have an example of adding a MQRFH2 header (In JAVA) to a regular mq message to make a JMS message?
I am new to this, so I hope I don't sound TOO dumb. thanks for any help. |
|
Back to top |
|
 |
vennela |
Posted: Tue Sep 14, 2004 6:19 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Quote: |
then add a MQRFH2 header and it becomes a JMS message that can be put on another queue to be picked up by a message driven bean? |
Even if you don't have MQRFH2 header to your message, i,e, even if it is straight MQ message MDB will pick it up. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Sep 14, 2004 11:38 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
There is no definition to a "JMSMessage" and a non "JMSMessage"
Any MQ message can be treated as a "JMS" message. However the information on the message can be more complete or more scarse.
The most complete information is on a message with an RFH2 header.
This does not mean that a message without RFH2 header needs special treatment before it can be consumed. Our messages come from non JMS applications, and thus without an RFH2 header and we consume them without transformation from JMS (MDB).
Without the RFH2 header there are just a number of attributes to the message that will not be available. Check out the manual using java for the different mappings from MQMD and RFH2 structures.
Enjoy |
|
Back to top |
|
 |
bamboozled_by_MQ |
Posted: Fri Oct 01, 2004 10:33 am Post subject: |
|
|
Voyager
Joined: 07 Jan 2004 Posts: 75
|
i am still a little confused..
if I have a native MQ queue that has an MQ message on it. I want a generic JMS program to read the message and then pass the data on to a newer j2ee architecture, do I need to break down the message and rebuild it first(adding the mqrfh2 header)?
basically going from ative MQseries and I want to make it pure JMS and then pass to another j2ee component
im very new to this, so thank you |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Oct 01, 2004 10:40 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
No, you don't need to deconstruct the message.
JMS will read the message without an RFH2 header just as well as if it had one. The big difference is in the envelope information that is not the same whether you use the RFH2 header or not.
Enjoy  |
|
Back to top |
|
 |
|