ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Can i read the message put by MQ Native API, using JMS API.

Post new topic  Reply to topic
 Can i read the message put by MQ Native API, using JMS API. « View previous topic :: View next topic » 
Author Message
say_2_anil
PostPosted: Fri Dec 01, 2006 3:14 am    Post subject: Can i read the message put by MQ Native API, using JMS API. Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Fri Dec 01, 2006 3:19 am    Post subject: Reply with quote

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
View user's profile Send private message
say_2_anil
PostPosted: Fri Dec 01, 2006 3:30 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Fri Dec 01, 2006 3:35 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Fri Dec 01, 2006 3:38 am    Post subject: Reply with quote

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
View user's profile Send private message
mvic
PostPosted: Fri Dec 01, 2006 4:20 am    Post subject: Re: Can i read the message put by MQ Native API, using JMS A Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Fri Dec 01, 2006 4:30 am    Post subject: Reply with quote

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
View user's profile Send private message
say_2_anil
PostPosted: Fri Dec 01, 2006 4:50 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Fri Dec 01, 2006 5:22 am    Post subject: Reply with quote

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
View user's profile Send private message
mvic
PostPosted: Fri Dec 01, 2006 6:29 am    Post subject: Reply with quote

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
View user's profile Send private message
billybong
PostPosted: Sun Dec 03, 2006 7:34 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Sun Dec 03, 2006 9:24 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
say_2_anil
PostPosted: Mon Dec 04, 2006 2:15 am    Post subject: Reply with quote

Newbie

Joined: 16 Nov 2006
Posts: 8

Thanks for your inputs
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Can i read the message put by MQ Native API, using JMS API.
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.