Posted: Mon Feb 21, 2005 6:23 am Post subject: Problem with MQRFH2 Struct Length updation using MSGEXIT.!!
Novice
Joined: 01 May 2003 Posts: 23 Location: UK
Hi All,
We are trying to update the message by inserting a new tag in the usr area of MQRFH2 header thru channel exit (MSGEXIT). To achieve this we are doing the following things.
1) We are modifying it in the Agent buffer itself, if it has sufficient memory to accommodate the new tag. Otherwise we will be using Exit buffer to insert the new tag.
2) When the message comes with MQMD_ENCODING as UNIX, we modify the MQRFH2 struct length to include the size of new tag in the usr area. This message is successfully parses by our message flow.
3) When the message comes with MQMD_ENCODING as PC,we swap the MQRFH2 struct length to UNIX format(as structlength was in Big endian format) to include the size of newly added tag of the usr area and re-swapping the modified MQRFH2 struct length to PC format. But this message was not parsed by the message flows. The reason we found here is re-swapped value is not going into the queue with PC format. We are using MQPUT1 call in the message exit to put the message into the Queue.
Here why the MQRFH2 structlength value is not changing to PC format, Eventhough we are assigning the structlength value in PC format(Little endian).
If we don't change the struct length, the message goes with PC format value for Struct Length of MQRFH2. Why if we change the Struct Length value , then the message goes with UNIX format only.
Function used to swap the value
-------------------------------
long *swap_long_4(long *tni4) // 4 byte signed long integers
{
*tni4=(((*tni4>>24)&0xff) | ((*tni4&0xff)<<24) |
((*tni4>>&0xff00) | ((*tni4&0xff00)<<);
return tni4;
}
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