Posted: Wed Aug 21, 2002 5:35 pm Post subject: Putting multiple messages
Newbie
Joined: 08 Aug 2002 Posts: 8
I need some help for putting multiple messages in a queue. For simplicity I have a header, detail and end of message data to be placed in a queue. I am thinking of 2 ways:
1) concatenating all of them and send them at once. I am
wondering if this is the best way of doing this.
2) put one message at a time?
Then the question is how do I get them as a group?
Concatenating all of your data into a single MQ message is quite a good idea since it keeps everything together and avoids the overheads of multiple messages. The down side is message size - how many detail records and how big are they. If the size/number of detail records is variable it may be easier to write each as individual mesages.
If you do issue mulitiple messages you can use the MQPMO_SYNCPOINT option to ensure that the batch of messages is complete - even if the applications fails you wouldn't have a header without the associated trailer.
You can also use the group id and associated get/put options to identify the messages as a logical group.
Bob _________________ Bob Buxton
Ex-Websphere MQ Development
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