Author |
Message
|
lillo |
Posted: Wed Jul 16, 2003 2:10 am Post subject: Generate a new MsgId in a compute |
|
|
Master
Joined: 11 Sep 2001 Posts: 224
|
Hi,
Is it possible to generate a new MsgId inside a compute node?
I know it is possible to do this putting a message in a queue and selecting the appropiate option, but this is not want I want to do.
TIA, _________________ Lillo
IBM Certified Specialist - WebSphere MQ |
|
Back to top |
|
 |
Craig B |
Posted: Wed Jul 16, 2003 3:27 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
New Message Ids are generated by the queue manager at MQPUT time as instructed by the put message options or through the use of MQMI_NONE. I do not believe that WMQI offers any function that can generate a message id in a similar fashion that the queue manager does. The user can construct their own OutputRoot.MQMD.MsgId field value and have this populated in the output message, but there is no guarantee that this MsgId will be unique to the queue manager. If you did want to generate your own unique ids then the closest you can get to this in ESQL is to use the UUIDASBLOB function to generate a unique BLOB UUID which would then need to be manipulated to fit into the MsgId field. The only danger is that the manipulation to shorten it may take away the uniqueness. _________________ Regards
Craig |
|
Back to top |
|
 |
jfluitsm |
Posted: Wed Jul 16, 2003 9:53 am Post subject: |
|
|
Disciple
Joined: 24 Feb 2002 Posts: 160 Location: The Netherlands
|
UUIDASBLOB will fit into MsgId as it is 16 bytes long.
Be careful what to do with the other 8 bytes (binary zero? before or after the UUID?). _________________ Jan Fluitsma
IBM Certified Solution Designer WebSphere MQ V6
IBM Certified Solution Developer WebSphere Message Broker V6 |
|
Back to top |
|
 |
rwa |
Posted: Wed Jul 16, 2003 11:19 pm Post subject: |
|
|
Voyager
Joined: 22 Jan 2002 Posts: 76 Location: Duesseldorf/Germany
|
What is the reason to compute a MsgId without an MQPUT?
Do you need the MsgId befor an MQPUT or an MQCMIT?
If it is MQCMIT you can do the MQPUT in an transaction read the MsdId, compute whatever you want and the do the MQCMIT controlled by the result of the computation (if needed). |
|
Back to top |
|
 |
EgilsJ.Rubenis |
Posted: Thu Jul 17, 2003 12:15 am Post subject: |
|
|
Acolyte
Joined: 18 Nov 2002 Posts: 63 Location: Germany, Alfeld
|
Hi,
the follwoing statement works in ESQL for the CorrelID.
SET "OutputRoot"."MQMD"."CorrelId" = MQCI_NEW_SESSION;
I haven't cheked if it also works for the MsgID. I would guess so.
Egils |
|
Back to top |
|
 |
Craig B |
Posted: Thu Jul 17, 2003 6:56 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
MQCI_NEW_SESSION is a Websphere MQ constant that instructs the Websphere MQ queue manager that a new CICS bridge session is to be started and hence new sequence numbers should be used. These constants are similar to MQMI_NONE and MQCI_NONE etc, that are only actioned by the queue manager at MQPUT time. Using such constants will not give you the value in the message tree before the MQPUT from an MQOutput node. And in this case, the user wants to avoid the use of the MQOutput node. _________________ Regards
Craig |
|
Back to top |
|
 |
vmcgloin |
Posted: Thu Jul 17, 2003 7:23 am Post subject: |
|
|
Knight
Joined: 04 Apr 2002 Posts: 560 Location: Scotland
|
Lillo,
Why do you want to do this? Presumably you will be using the Output node at some point, so could you arrange the logic so that the Compute node is after the output node? I might be wrong (I often am) but I recall connecting up the out terminal of an MQOutput node to retrieve the MsgId of a message, in a message flow once.
Let us know what you end up doing...
Cheers,
Vicky |
|
Back to top |
|
 |
lillo |
Posted: Fri Jul 18, 2003 1:41 am Post subject: |
|
|
Master
Joined: 11 Sep 2001 Posts: 224
|
rwa wrote: |
What is the reason to compute a MsgId without an MQPUT?
|
I am using two aggregate in a row. In my second aggregate I need to pass some information directly to the Fan-in message flow. Actually I´m doing this generating a new MsgId in the MQOutput node and having an extra dummy message flow (MQInput and MQReply).
Because the message is in the second aggregate flow, I got an error indicating the MessageId is not unique.
TIA _________________ Lillo
IBM Certified Specialist - WebSphere MQ |
|
Back to top |
|
 |
|