|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to parse the raw MQ Message |
« View previous topic :: View next topic » |
Author |
Message
|
sri |
Posted: Mon Mar 15, 2004 10:09 pm Post subject: How to parse the raw MQ Message |
|
|
 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 |
|
 |
jefflowrey |
Posted: Tue Mar 16, 2004 4:35 am Post subject: |
|
|
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 |
|
 |
sri |
Posted: Tue Mar 16, 2004 11:13 pm Post subject: |
|
|
 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 |
|
 |
clindsey |
Posted: Wed Mar 17, 2004 12:36 pm Post subject: |
|
|
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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|