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 IndexMainframe, CICS, TXSeriesXML VARIABLE LENGTH MESSAGES

Post new topicReply to topic
XML VARIABLE LENGTH MESSAGES View previous topic :: View next topic
Author Message
deadalen
PostPosted: Thu Jun 08, 2006 12:54 pm Post subject: XML VARIABLE LENGTH MESSAGES Reply with quote

Newbie

Joined: 08 Jun 2006
Posts: 4

I’m sending message to a remote MQ on the mainframe. The messages are xml text (and as such, are variable length). I’m writing a certain number (usually 50) messages to the queue, before committing them.

The first message of each committed set seems to be processed fine. Subsequent messages that are shorter in length than the previous message contain the end of the previous message, padding it out to the max length. Here’s an example:

<A b=”123”><B c=”456”></B></A>
<A b=”1”><B c=”2”></B></A></A>
The trigger type of the remote queue is “FIRST”. I’m not a mainframe programmer, but from the little research that I’ve done, it seems that CICS begins a transaction when triggered, which lasts until the queue is empty. This implies to me that the buffer used to pass in the message from the queue is cleared when the transaction begins, but not as each message is read. Has anyone encountered this before, and if so, is there a way to fix this so that the buffer is cleared before the next message is read?
Back to top
View user's profile Send private message
kevinf2349
PostPosted: Thu Jun 08, 2006 1:24 pm Post subject: Reply with quote

Grand Master

Joined: 28 Feb 2003
Posts: 1311
Location: USA

You need to either clear the buffer or set the correct buffer length for each put.

Personally I would set the correct length of the message, but you have the choice.
Back to top
View user's profile Send private message
deadalen
PostPosted: Thu Jun 08, 2006 1:59 pm Post subject: JAVA/JMS Reply with quote

Newbie

Joined: 08 Jun 2006
Posts: 4

Thanks for your quick reply. I should add that I'm using Java/JMS to send the message. I checked the API, I don't think there is a way to specify the message length. I'm guessing that's being handled behind the scenes.

I also checked using the IBM MQ JAVA Classes directly, instead of JMS, and there also does not seem to be a way to set the message length. Probably also handled behind the scenes.


Thanks again.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Jun 08, 2006 2:02 pm Post subject: Re: JAVA/JMS Reply with quote

Grand High Poobah

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

deadalen wrote:
Thanks for your quick reply. I should add that I'm using Java/JMS to send the message. I checked the API, I don't think there is a way to specify the message length. I'm guessing that's being handled behind the scenes.

I also checked using the IBM MQ JAVA Classes directly, instead of JMS, and there also does not seem to be a way to set the message length. Probably also handled behind the scenes.


Thanks again.

I would expect your program to be at fault.
How are you building the message content that your are passing to the message?

Using a StringBuffer? Does it get cleared / rebuild for each message?

Enjoy the fun of hunting down errors
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
deadalen
PostPosted: Thu Jun 08, 2006 2:19 pm Post subject: Reply with quote

Newbie

Joined: 08 Jun 2006
Posts: 4

To attempt to prove that the program was not at fault, we switched from writing to the remote queue, to writing to a local queue, and we read the messages back from the local queue as they were being written.

The results were good. The messages were read back without any of the problems listed below. One interesting note is that we committed after each read, so maybe I should retry this test and commit every 50th record?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Jun 08, 2006 2:32 pm Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Maybe it is the CICS transaction that is not clearing the buffer that is being used.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
kevinf2349
PostPosted: Thu Jun 08, 2006 6:31 pm Post subject: Reply with quote

Grand Master

Joined: 28 Feb 2003
Posts: 1311
Location: USA

Quote:
This implies to me that the buffer used to pass in the message from the queue is cleared when the transaction begins, but not as each message is read. Has anyone encountered this before, and if so, is there a way to fix this so that the buffer is cleared before the next message is read?


You are correct. MQ will not initialise (or clear) the buffer between gets....that is the application programs responsibility As Jeff says it sounds like the CICS transaction is to blame. I bet they don't check the length of the message returned and use the buffer length as this value....this is bad coding. You should always check the buffer using the actual length value, not the buffer length.

Hope this helps.
Back to top
View user's profile Send private message
deadalen
PostPosted: Fri Jun 09, 2006 4:20 am Post subject: Reply with quote

Newbie

Joined: 08 Jun 2006
Posts: 4

Thanks, I’ll pass these suggestions to the programmers on the mainframe.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexMainframe, CICS, TXSeriesXML VARIABLE LENGTH MESSAGES
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.