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 » How to parse the raw MQ Message

Post new topic  Reply to topic
 How to parse the raw MQ Message « View previous topic :: View next topic » 
Author Message
sri
PostPosted: Mon Mar 15, 2004 10:09 pm    Post subject: How to parse the raw MQ Message Reply with quote

Apprentice

Joined: 14 Mar 2004
Posts: 32
Location: Chennai - India

Hi

I have written a MQReceiveExit program in Java. In that exit program, Iam capturing the agentbuffer parameter which gives me the complete MQ message which includes some raw bytes(I hope MQMD) and the application data at the end.

Now, I need a standard logic to parse the complete message and segregate the application data.

If u see the message, the byte 492 shows the application data length. Can i always use this byte to get the application data length and assume that the byte 493 is the starting point for application data.

thanks
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Mar 16, 2004 4:35 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Are you sure you can write Receive Exits in Java?

Have you read Chapter 47 of the Intercommunications Manual?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
sri
PostPosted: Tue Mar 16, 2004 11:13 pm    Post subject: Reply with quote

Apprentice

Joined: 14 Mar 2004
Posts: 32
Location: Chennai - India

hi jefflowrey,

I have written in Java only. I have written exit in java by implimenting the Interface MQReceiveExit (Interface). I have also written separate program to "get" the message from Queue, and set the instance of the receive exit to MQEnvironment.receiveExit property.

I did not do any special configurations in MQ Server side.

My exit is being invoked whenever i run my "get" message program.

I hope, this is the Receive exit for Client connection channel.

thanks
Back to top
View user's profile Send private message
clindsey
PostPosted: Wed Mar 17, 2004 12:36 pm    Post subject: Reply with quote

Knight

Joined: 12 Jul 2002
Posts: 586
Location: Dallas, Tx

Sri,

The Using Java book really doesn't give you enough (or any) detail on the agentBuffer. Take a look at the reference Jeff gave, chapter 46 of the Intercommunicaion guide. That is in Part 7 of the book. What you will find in this document is this:
Quote:

The channel send and receive exit programs are passed an agent buffer containing the transmission data as sent or received from the communications link. For send exit programs, the first eight bytes of the buffer are reserved for use by the MCA, and must not be changed. If the program returns a different buffer, then these first eight bytes must exist in the new buffer. The format of data presented to the exit programs is not defined.


As a general rule, the content beyond the first 8 bytes doesn't matter because send/receive exits are written in pairs, i.e. message compression and the action is done to the complete buffer and then undone at the other end. If you are trying to deal only with the message, then you should consider a Message exit. As I recall, though it is not available in java.

Charlie[/quote]
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 » How to parse the raw MQ Message
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.