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 Index » WebSphere Message Broker (ACE) Support » MQ Message Groups from eSQL?

Post new topic  Reply to topic
 MQ Message Groups from eSQL? « View previous topic :: View next topic » 
Author Message
Kjell
PostPosted: Sun Nov 16, 2003 12:56 pm    Post subject: MQ Message Groups from eSQL? Reply with quote

Acolyte

Joined: 26 Feb 2002
Posts: 73

Hi, consider this situation:

1 I get one big message to the MQInput node. Essentially this is a file with thousands of records, sent as one single MQ message.

2. I have a node where I split the message into one message for each record, using eSQL. I PROPAGATE them one by one.

3. It's a requirement to guarantee that the receiving node can read all the messages in one sequence, so I need to use MQ Message Groups.
For each message I propagate I set OutputRoot. MQMD.Msgflag = 8 (meaning message belongs to a group) except for the last record where I set this flag to 24 (meaning last message of the group).

Now to my problem: When I do as above MQ seems to generate a new ID for each record! I don't want this. I want them all to belong to the same MsgGroup.
I have tried to set the field MQMD.MsgGroupID. It's tricky because it expects a BLOB, and it has to be 10 digits.

OR, maybe I got it all wrong? Maybe it's some setting on the MQOutput node that sets all this?

Anyone?

Regards Kjell
Back to top
View user's profile Send private message
EddieA
PostPosted: Mon Nov 17, 2003 10:21 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Don't think you can tell WMQI to use the MQ Groups for output. Probably because there's no correlation between messages. The Output node doesn't know they all came from one input message.

Why is setting a GroupId a problem. Just take something unique, like a TimeStamp, and cast it as a BLOB and SUBSTRING it. But even if you do this, I seem to remember someone else in this forum saying it still doesn't work. But try.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
Tibor
PostPosted: Mon Nov 17, 2003 3:51 pm    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

Kjell, if you aren't sure about your GroupId, use the MsgId of original message. This is unique and BLOB .

MsgFlags advice: using constants is more readable, e.g.
Code:

SET OutputRoot.MQMD.MsgFlags=MQMF_MSG_IN_GROUP;
-- and
SET OutputRoot.MQMD.MsgFlags=MQMF_MSG_IN_GROUP + MQMF_LAST_MSG_IN_GROUP;
Back to top
View user's profile Send private message
Kjell
PostPosted: Tue Nov 18, 2003 2:31 am    Post subject: Reply with quote

Acolyte

Joined: 26 Feb 2002
Posts: 73

Hi and thanks for your advices.

I still do not have it work. The reason seems to be that MQ updates the GroupID field probably AFTER the compute node as to where the GroupID is set by my eSQL.

I tried:
DECLARE savemsggroup;
- For the 1st message
- PROPAGATE;
- SET Savemsggroup = OutputRoot.MQMD.MsgGroupID;
for the rest of the messages
- SET OutputRoot.MQMD.MsgGroupID = Savemsggroup;
- PROPAGATE;

It does not work. When landing at the output queue they all have individual GroupID:s anyhow.

My gut feeling is that I have to do something with the MQOutput node to have it set the proper Put Option, but... how to do it?


Regards Kjell
Back to top
View user's profile Send private message
Tibor
PostPosted: Tue Nov 18, 2003 4:45 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

Kjell, look a code snippet for example: (an IDOC splitting)

Code:

   SET OutputRoot.Properties = InputRoot.Properties;
   SET OutputRoot.MQMD = InputRoot.MQMD;
   SET OutputRoot.MQMD.Version = MQMD_VERSION_2;
   SET OutputRoot.MQMD.CorrelId = corid;
   SET OutputRoot.MQMD.GroupId = corid;
   SET OutputRoot.MQMD.MsgSeqNumber = sqn;
   SET OutputRoot.MQMD.MsgFlags = CASE
      WHEN pos + seg < mlen then MQMF_MSG_IN_GROUP
      WHEN sqn = 1          then MQMF_NONE
      ELSE                       MQMF_MSG_IN_GROUP + MQMF_LAST_MSG_IN_GROUP
      END;
   SET OutputRoot.BLOB.BLOB =
      SUBSTRING(InputRoot.BLOB.BLOB FROM 1 FOR 524) ||
      SUBSTRING(InputRoot.BLOB.BLOB FROM 525 + pos*1063 FOR seg*1063);
PROPAGATE;


More notes:
- Root.MQMD has an element 'GroupId' not 'MsgGroupId'
- if your message version is MQMD_VERSION_1 you have to set MQMD_VERSION_2
Back to top
View user's profile Send private message
Kjell
PostPosted: Wed Nov 19, 2003 5:59 am    Post subject: Reply with quote

Acolyte

Joined: 26 Feb 2002
Posts: 73

and how is corid populated in the first place?
Back to top
View user's profile Send private message
Tibor
PostPosted: Wed Nov 19, 2003 4:58 pm    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

Kjell wrote:
and how is corid populated in the first place?


This is a BLOB (MQBYTE24) variable, similar to CorrelId or MsgId.

Code:
DECLARE corid BLOB;
SET corid=InputRoot.MQMD.CorrelId;
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » MQ Message Groups from eSQL?
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.