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 » Reading MQ...

Post new topic  Reply to topic
 Reading MQ... « View previous topic :: View next topic » 
Author Message
DeadHead
PostPosted: Thu Sep 28, 2006 11:36 am    Post subject: Reading MQ... Reply with quote

Novice

Joined: 28 Sep 2006
Posts: 12

New at MQ & Java. I have a Java MQ Client app that is running on an ISeries/AS400 that is reading from the MQ Server which is located on another ISeries/AS400 box. All it has to do is read the MQ message and write it out to a DDM DataQ that exists on the ISeries/AS400. When I copy/paste a test message using MQ Explorer to the MQQueue, my app reads it just fine and writes it to the DataQ on the ISeries. When I try to read a message that is sent to me from the Java/JMS 3rd party software, MQ is attaching a header to each message and NOTHING gets written. It does drop off the MQQueue though. This app is being written to deal with these messages coming from the 3rd party software. Is their a way to strip this header info off or even send an MQ message without header info? Any help or ideas would be very appreciated.. Thanks in advance.
_________________
"One man gathers what another man spills" GD
Back to top
View user's profile Send private message Send e-mail
special_agent_Queue
PostPosted: Thu Sep 28, 2006 11:48 am    Post subject: Reply with quote

Centurion

Joined: 27 Jul 2006
Posts: 102

All messages traveling through MQ must have at least a MQMD header.
Back to top
View user's profile Send private message
DeadHead
PostPosted: Thu Sep 28, 2006 11:51 am    Post subject: Reply with quote

Novice

Joined: 28 Sep 2006
Posts: 12

special_agent_Queue wrote:
All messages traveling through MQ must have at least a MQMD header.

Is there any slick way of stripping this off and just dealing with the data message in order to write it out?
_________________
"One man gathers what another man spills" GD
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Thu Sep 28, 2006 12:26 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

All messages passing through WebSphere MQ must have an MQMD on them.

All WebSphere MQ APIs give you a simple means to access the message data without having to access the MQMD or deal with the MQMD.

JMS messages using the WebSphere MQ JMS Provider tend to have an MQRFH2 header attached to them, that will be in the first part of the message body.

If your message body starts with MQHRF, then this is your problem.

You can ask nicely if the sending application will change their Queue Destination definition to set Target Client to MQ, instead of having it set to JMS. This will cause the MQRFH2 header not to be included.

You can read the Using Java manual and the Application Programming Guide/Reference to find out how to strip an MQRFH2 header by hand, if the sender won't specify Target Client.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
DeadHead
PostPosted: Thu Sep 28, 2006 1:42 pm    Post subject: Reply with quote

Novice

Joined: 28 Sep 2006
Posts: 12

Thanks jefflowrey for the insight... It cleared up some...shall we say...confusion... You can bet I'll be checking the manual as you suggested too. This is a great site wih a lot of experience hanging around. Thanks again.
_________________
"One man gathers what another man spills" GD
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Thu Sep 28, 2006 2:38 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

You can also write your application in JMS and thus let JMS deal with the JMS header.
The JMS API will allow you direct access to the message content whether there is a JMS header or not...
Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Reading MQ...
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.