|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQMD Group Id questions |
« View previous topic :: View next topic » |
Author |
Message
|
RogerLacroix |
Posted: Thu Nov 22, 2007 1:09 pm Post subject: MQMD Group Id questions |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
All,
I have 2 questions related to a message's Group Id:
1) I thought you could set a Group Id but I am only creating a system generated Group Id.
i.e.
MQPutMessageOptions pmo = new MQPutMessageOptions();
pmo.options = MQC.MQPMO_LOGICAL_ORDER | MQC.MQPMO_SYNCPOINT;
MQMessage msg = new MQMessage();
msg.groupId = "MyGroupId001 ".getBytes();
msg.format = MQC.MQFMT_STRING;
msg.messageFlags = MQC.MQMF_MSG_IN_GROUP;
msg.writeString("Test message "+index);
outQ.put(msg, pmo);
2) I wanted to edit message # 2 in a group of 10 messages. I can get the particular message but I cannot insert it back to the group. I set the GroupId, MessageFlags and MessageSequenceNumber of the MQMD but after the put, the fields are null (zero).
I thought there was a put option called MQPMO_NEW_GROUP_ID but it does not exist.
Do I need a vacation or am I missing something?
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
Vitor |
Posted: Fri Nov 23, 2007 7:23 am Post subject: Re: MQMD Group Id questions |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
RogerLacroix wrote: |
Do I need a vacation or am I missing something?
|
1) It does say in the APR that if you're putting a message with message in group set & logical order set then you either get a new group id or the previous one. Logical order has to be unset for you to specify a group id.
2) You're right, it doesn't. Nearest seems to be MQGI_NONE which prompts the queue manager to generate a new id.
That's my interpretation. I may be missing something (indeed a different something) or need time by the pool next to you.....  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Nigelg |
Posted: Fri Nov 23, 2007 8:07 am Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
Here is the answer to 1 (from the APR, MQMD, GroupID
It specifically states
Quote: |
Message groups and segments can be processed correctly only if the group identifier is unique. For this reason, applications must not generate their own group identifiers; instead, applications must do one of the following:
If MQPMO_LOGICAL_ORDER is specified, the queue manager automatically generates a unique group identifier for the first message in the group or segment of the logical message, and uses that group identifier for the remaining messages in the group or segments of the logical message, so the application does not need to take any special action. This is the recommended procedure.
If MQPMO_LOGICAL_ORDER is not specified, the application must request the queue manager to generate the group identifier, by setting GroupId to MQGI_NONE on the first MQPUT or MQPUT1 call for a message in the group or segment of the logical message. The group identifier returned by the queue manager on output from that call must then be used for the remaining messages in the group or segments of the logical message. If a message group contains segmented messages, the same group identifier must be used for all segments and messages in the group. |
Don't set MQPMO_LOGICAL _ORDER if you want to use your own GroupId, but do get the qmgr to allocate it for you. If you ignore this advice, at your peril, user Table 53 to determine what values and options will produce what results. Note that you can easily produce ungettable group msgs when you specify MQGMO_ALL_MSGS_AVAILABLE to the MQGET if you have not set the flags properly.
As for number 2, Table 53 in the APR describes what the values for the group fields will be after MQPUT depending on the options, so you can put the msg back in its place in the group by using the options and fields. The same health warning applies... _________________ MQSeries.net helps those who help themselves.. |
|
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
|
|
|
|