Author |
Message
|
say_2_anil |
Posted: Fri Dec 01, 2006 3:14 am Post subject: Can i read the message put by MQ Native API, using JMS API. |
|
|
Newbie
Joined: 16 Nov 2006 Posts: 8
|
Hi,
We did put a message onto the queue using MQ Native API (using MQMessage).
I require that to be read by JMS Client.
Now How can i access that message using JMS API, i mean by which message subtype out of the following.
Stream, Map, Text, Object and Bytes
Thanks,
Anil Kumar Mithinti. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Dec 01, 2006 3:19 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Which subtypes have you tried? What happened when you tried? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
say_2_anil |
Posted: Fri Dec 01, 2006 3:30 am Post subject: |
|
|
Newbie
Joined: 16 Nov 2006 Posts: 8
|
I tried to cast the received message (which was pushed using MQ Native MQMessage) to TextMessage, but it has given ClassCastException.
when i tried to print the JMSType using Message.getJMSType(). it is giving NullPointerException. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Dec 01, 2006 3:35 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
You need to spend a little time with the Using Java manual.
A message placed with the standard interface will not have an RFH2 header, and so the jms properties will be missing. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Dec 01, 2006 3:38 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Sorry, to clarify a little - a message placed with the native interface will not have an RFH2 header unless specific application action is taken to add it and so the jms properties (like JMSType) will be missing.
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mvic |
Posted: Fri Dec 01, 2006 4:20 am Post subject: Re: Can i read the message put by MQ Native API, using JMS A |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
say_2_anil wrote: |
I require that to be read by JMS Client. |
May I ask, why is this a requirement? |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Dec 01, 2006 4:30 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
say_2_anil wrote: |
I tried to cast the received message (which was pushed using MQ Native MQMessage) to TextMessage, but it has given ClassCastException. |
Then probably the MQMD.Format <> MQFMT_STRING. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
say_2_anil |
Posted: Fri Dec 01, 2006 4:50 am Post subject: |
|
|
Newbie
Joined: 16 Nov 2006 Posts: 8
|
Hi,
My requirement is like that only,
There is a source application which puts the message onto MQ Server using the native API.
and My destination application will receive the message from the server using the JMS APIs.
Thanks,
Anil |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Dec 01, 2006 5:22 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If you want your destination application to receive TextMessages, then your source application needs to indicate that the message is string data.
This is done with the MQMD, by setting the Format field to MQFMT_STRING.
Note that this does not break the separation between senders and receivers, because it does not require that the sender know anything about the receiving applications. It is just that the sender has to properly label its messages to accurately represent what they are. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
mvic |
Posted: Fri Dec 01, 2006 6:29 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
say_2_anil wrote: |
There is a source application which puts the message onto MQ Server using the native API.
and My destination application will receive the message from the server using the JMS APIs. |
If you have an app writing messages onto this queue using non-JMS formats, wouldn't it be better to keep this queue solely for similar messages? Then you could process the queue using a non-JMS app.
In other words, can you use separate queues: one for JMS messages, one for non-JMS messages? |
|
Back to top |
|
 |
billybong |
Posted: Sun Dec 03, 2006 7:34 am Post subject: |
|
|
 Disciple
Joined: 22 Jul 2005 Posts: 150 Location: Stockholm, Sweden
|
Listen to Jeff. Format="MQSTR " , problem solved.
I think that if you want to go the other way, sending from a jms app to an MQI reciever, you have to specify it (dont remember exactly how) in order to strip the extra JMS headers. _________________ IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Integration Developer V6.0
IBM Certified System Administrator - WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere DataPower |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Dec 03, 2006 9:24 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
billybong wrote: |
Listen to Jeff. Format="MQSTR " , problem solved.
I think that if you want to go the other way, sending from a JMS app to an MQI receiver, you have to specify it (don't remember exactly how) in order to strip the extra JMS headers. |
You have to specify targetClient=1 on the JMS Destination going the other way...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
say_2_anil |
Posted: Mon Dec 04, 2006 2:15 am Post subject: |
|
|
Newbie
Joined: 16 Nov 2006 Posts: 8
|
|
Back to top |
|
 |
|