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 » Create Message Groups

Post new topic  Reply to topic
 Create Message Groups « View previous topic :: View next topic » 
Author Message
wyatt
PostPosted: Thu Jul 12, 2007 3:31 pm    Post subject: Create Message Groups Reply with quote

Voyager

Joined: 28 Nov 2004
Posts: 76

How does one go about creating a message that is part of a "MQSeries Message Group". Using MQSeries API the recommend approach is to set the message put option to MQPMO_LOGICAL_ORDER.

Is there equivalent in Message Broker.

This posts demonstrates use of OutputLocalEnvironment to set MQGET parameters. Can same pattern be used for MQPUT?

The Message Broker information Center doesnt describe this approach.

http://www.mqseries.net/phpBB2/viewtopic.php?t=37131&highlight=outputlocalenvironment+mq
Back to top
View user's profile Send private message
wyatt
PostPosted: Fri Jul 13, 2007 10:55 am    Post subject: Reply with quote

Voyager

Joined: 28 Nov 2004
Posts: 76

The following code :
======================================
Set Environment.currentOffSet = 1;
WHILE (Environment.currentOffSet < iMsgLen) DO
CALL CopyMessageHeaders();


/*copy message payload to output tree*/
SET OutputRoot.BLOB.BLOB = SUBSTRING(InputRoot.BLOB.BLOB from Environment.currentOffSet for msgSegSize);
SET Environment.currentOffSet = Environment.currentOffSet + msgSegSize; --while counter
--CALL setupCommonOutputMQMD(); --setup MQMD properties
--CALL setupCommonOutputTree(); --setup options for message groups

/*message group sequence number housekeeping*/
SET OutputRoot.MQMD.MsgSeqNumber = indx;
SET indx = indx + 1;
SET OutputLocalEnvironment.Destination.MQDestinationList.Defaults.MsgFlags = MQPMO_LOGICAL_ORDER;
SET OutputLocalEnvironment.Destination.MQDestinationList.Defaults.GroupId = 'xxx';
SET OutputLocalEnvironment.MQ.PUT.MQPMO.MsgFlags = MQPMO_LOGICAL_ORDER;

SET OutputLocalEnvironment.Destination.MQDestinationList.DestinationData[1].queueName = 'SYSTEM.DEFAULT.LOCAL.QUEUE';
PROPAGATE;
END WHILE;
===============================

Results in error:
An MQ output node with the "Destination Mode" property set to "list" received a message containing a distribution list. However the "Defaults" or "DestinationData" folder contained an field with an invalid value. Only specific values are allowed in this situation.

This is somewhat encouraging as the MsgFlags are recognized by still cant create message groups?

Any suggestions?
Back to top
View user's profile Send private message
wbi_telecom
PostPosted: Fri Jul 13, 2007 11:42 am    Post subject: Reply with quote

Disciple

Joined: 15 Feb 2006
Posts: 188
Location: Harrisburg, PA

I think its failing because the values that you have under Defaults folder are not valid. Check out the topic on "Data types for elements in the DestinationData subtree" in infocenter. It gives table that has valid values and their datatypes.

Cheers,
Back to top
View user's profile Send private message
wyatt
PostPosted: Fri Jul 13, 2007 11:55 am    Post subject: Reply with quote

Voyager

Joined: 28 Nov 2004
Posts: 76

True, I did see the list of "valid" fields. But they did not include "put message options". Dont know how to create message group without them....
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jul 13, 2007 3:18 pm    Post subject: Reply with quote

Grand High Poobah

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

wyatt wrote:
True, I did see the list of "valid" fields. But they did not include "put message options". Dont know how to create message group without them....
Wouldn't you set that information on the MQMD before the output node in a compute node ??
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
TonyD
PostPosted: Fri Jul 13, 2007 4:08 pm    Post subject: Reply with quote

Knight

Joined: 15 May 2001
Posts: 540
Location: New Zealand

This piece of ESQL writes multiple messages that form a logical group (I think ... I haven't run it lately):

Code:


CREATE COMPUTE MODULE mfLogGrpPut_V6_Compute
   CREATE FUNCTION Main() RETURNS BOOLEAN
   BEGIN
       CALL CopyMessageHeaders();
      -- CALL CopyEntireMessage();
      DECLARE NumOfEmps INTEGER CARDINALITY(InputRoot.XML.DeptMsg.ListOfEmployees.Employee[]);
      DECLARE EmpCnt INTEGER 1;
      WHILE EmpCnt <= NumOfEmps DO
          SET OutputRoot = InputRoot;
           SET OutputRoot.XML = NULL;
           SET OutputRoot.MQMD.MsgType = MQMT_REPLY;
           SET OutputRoot.MQMD.MsgId = CAST('50524D534E5A524D' as blob) || UUIDASBLOB;
         SET OutputRoot.MQMD.CorrelId = CAST('50524D534E5A524D' as blob) || UUIDASBLOB;
           SET OutputRoot.MQMD.GroupId = CAST(X'313131313131313132323232323232323333333333333333' AS BLOB);
         SET OutputRoot.MQMD.MsgSeqNumber = EmpCnt;
         SET OutputRoot.MQMD.MsgFlags = 8;
         IF EmpCnt = NumOfEmps THEN
            SET OutputRoot.MQMD.MsgFlags = 24;
         END IF;
         SET OutputRoot.XML.DeptMsg.Employee = InputRoot.XML.DeptMsg.ListOfEmployees.Employee[EmpCnt];
         PROPAGATE;
         SET EmpCnt = EmpCnt + 1;
      END WHILE;
      RETURN FALSE;
   END;


The example reads a single MQ XML message that has multiple 'ListOfEmployees.Employee' elements and writes one MQ message for each employee.
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Sat Jul 14, 2007 4:56 am    Post subject: Reply with quote

Grand High Poobah

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

Looking at the above example:
I would never set the MsgId unless I absolutely need to...

And yes I know the example is out of context so apologies if I offended anybody...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
wyatt
PostPosted: Mon Jul 16, 2007 6:05 am    Post subject: Reply with quote

Voyager

Joined: 28 Nov 2004
Posts: 76

Interesting, when I execute a similiar piece of code, the message(s) is written to the replyToQ queue but the "GroupId", "MsgSeqNumber" and "MsgFlags" are not propagated to the output message. Basically they are ignored. That is why I started looking into the DestinationList approach.

Do you have other settings/configuration that instruct the broker to use the MQMD values as coded?
Back to top
View user's profile Send private message
wyatt
PostPosted: Mon Jul 16, 2007 10:49 am    Post subject: Reply with quote

Voyager

Joined: 28 Nov 2004
Posts: 76

the "message grouping" works when the MQOutput Node -> Destination Mode is set to "Queue Name". For some reason, when MQOutput Node -> Destination Mode is set to "Destination List" the message group fields are overridden. Anyone know what that might be?
Back to top
View user's profile Send private message
wyatt
PostPosted: Mon Jul 16, 2007 10:52 am    Post subject: Reply with quote

Voyager

Joined: 28 Nov 2004
Posts: 76

..sorry, when using "Reply To Queue" it does not work...
Back to top
View user's profile Send private message
wyatt
PostPosted: Sun Mar 16, 2008 7:48 am    Post subject: DestinationData Reply with quote

Voyager

Joined: 28 Nov 2004
Posts: 76

Using a DestinationList has advantages in that you can dynamically select the target queue name. The information center does not enumerate DestinationData fields such as MQMD.GroupID. Does anyone know if these fields can be modified in DestinationData?
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 » Create Message Groups
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.