|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQReceiveExit related issue |
« View previous topic :: View next topic » |
Author |
Message
|
krs |
Posted: Fri Mar 12, 2004 5:41 am Post subject: MQReceiveExit related issue |
|
|
Newbie
Joined: 12 Mar 2004 Posts: 1
|
Hi all,
I have 2 problems
Problem 1 :
I am trying to write a MQ API Exit (MQReceiveExit) in Java for the following scenario.
Scenario:
Just for the accounting purpose, I want to move the message that iam going to GET from the queue to an temporary media.
My assumption is that, When ever the MQGET client program is run, the corresponding exist program that i have set in the MQGET program will be invoked. In the exit program I will be getting the application data also, which i will move to the temporary media.
but, whats happening is different. When i run the MQGet program, for each and every "MQCalls", the exit program is getting invoked. that is, for QManager connect, open, close, disconnect calls also, the exist program is getting invoked. I think, when ever there is some message from the queue manager (even for handshake messages), the exit program will be invoked.
But, I want the exit program to be invoked only for the "get()" call. Not for connect/open/close and disconnect. Inside the exit program, I want to retrive the actual message that is going to be read by the "get()" method from the queue.
Problem 2 :
The method signature in the exit program is
public byte []receiveExit(MQChannelExit channelExitParms,MQChannelDefinition channelDefinition,byte []agentBuffer){
// implimentation
}
Here, agentBuffer gives the byte array, This includes both MQ Message header and Data. ie, Iam getting some junk followed by the data. How to segrigate the application data alone from the complete MQ message.
Any help/suggestion/solution is greatly appreciated.
Thanks |
|
Back to top |
|
 |
bower5932 |
Posted: Fri Mar 12, 2004 6:43 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
I haven't messed with java security exits. However, I'm guessing that you are running your java program as a client. The receive exit is looking at data that is received off of the wire and not at the data that your program would mqget. |
|
Back to top |
|
 |
sfari |
Posted: Fri Mar 19, 2004 1:47 am Post subject: |
|
|
Centurion
Joined: 15 Apr 2003 Posts: 144
|
The 10th byte of the agentBuffer tells you what kind of message it is. (Look at the Intercommunication Book page 628)
Checking this byte you can easily filter out the "MQGET reply" call, which I assume you are looking for. The agentBuffer of this call contains the message got from the queue.
Be careful sometimes the agentBuffer has the length 0. I have no Idea why. May somebody else could explain that? |
|
Back to top |
|
 |
sfari |
Posted: Fri Mar 19, 2004 1:51 am Post subject: |
|
|
Centurion
Joined: 15 Apr 2003 Posts: 144
|
I got the answer on my question. If you get an agentBuffer with zero length the reason the exit has been called is MQXR_INIT or MQXR_TERM. So this has nothing to do with data readion from and writing to the wire. |
|
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
|
|
|
|