Author |
Message
|
gecs |
Posted: Thu May 03, 2012 10:25 am Post subject: MQOutput Node question |
|
|
 Acolyte
Joined: 14 Nov 2007 Posts: 58
|
Hi everybody, I would like know if there is any form, method, etc... for get the "correlId" generated by the Queue Manager when I check the "new correlation ID" option of MQOutput Node (tag Advanced).
Thanks in advance,
Regards |
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu May 03, 2012 10:33 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
mqjeff |
Posted: Thu May 03, 2012 10:33 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
There are many many methods for getting this.
Did you want to get this value from within your flow? or did you just want to get the value?
Please look at Written Destination. |
|
Back to top |
|
 |
gecs |
Posted: Thu May 03, 2012 10:54 am Post subject: |
|
|
 Acolyte
Joined: 14 Nov 2007 Posts: 58
|
Thanks "lancelotlinc" and "mqjeff".
Just one last question... exists any method, algorythm, etc, for generate this value (correlation Id generated by MQOutput node) by ESQL, JAVA?
I should have mentioned I use a SOAPInput node and the "replyIdentifier" property doesn't help me so much...
some information:
MQ v7.0
Message Broker v7.0 |
|
Back to top |
|
 |
mqjeff |
Posted: Thu May 03, 2012 10:57 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You can write ESQL or Java to set a correlationID to any value you want.
You can't write ESQL or java to find out what the queue manager will set the id to BEFORE the queue manager sets it. |
|
Back to top |
|
 |
gecs |
Posted: Thu May 03, 2012 11:15 am Post subject: |
|
|
 Acolyte
Joined: 14 Nov 2007 Posts: 58
|
mqjeff wrote: |
You can write ESQL or Java to set a correlationID to any value you want.
You can't write ESQL or java to find out what the queue manager will set the id to BEFORE the queue manager sets it. |
OK... thanks!!! |
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu May 03, 2012 11:25 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Some fun facts about CorrelId :
1. CorrelIds, like MsgIds, are 24-byte blobs. They must be 24-bytes exactly, pad with zeros if needed.
2. You can get a human-readable version by CASTing in ESQL or a special routine in Java (Google this forum for code example).
3. Most Request/Reply scenarios where Broker is the Requestor, would not set a CorrelId, but instead would MQGet for a CorrelId that matches the Request MsgId.
4. Most Request/Reply scenarios where Broker is the Replier, would copy the incoming MsgId to the outgoing CorrelId.
5. When in doubt, use your brain before the debugger. To help your brain function, add Trace nodes before and after every major node in your flow.
6. Broker flows are simple and easy. Take my word for it.
7. QMgr-set CorrelIds are loosely a combination of timestamp and system name. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
mqjeff |
Posted: Thu May 03, 2012 11:27 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
lancelotlinc wrote: |
7. QMgr-set CorrelIds are loosely a combination of timestamp and system name. |
for extremely loose definitions of 'system name'. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu May 03, 2012 11:28 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
gecs wrote: |
I use a SOAPInput node and the "replyIdentifier" property doesn't help me so much... |
SOAPInput replyIdentifier would make a great CorrelId. Why do you not want to use it? It is unique. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
mqbrks |
Posted: Thu May 03, 2012 11:48 am Post subject: |
|
|
Voyager
Joined: 17 Jan 2012 Posts: 75
|
lancelotlinc wrote: |
gecs wrote: |
I use a SOAPInput node and the "replyIdentifier" property doesn't help me so much... |
SOAPInput replyIdentifier would make a great CorrelId. Why do you not want to use it? It is unique. |
ReplyIdentifier is not unique.....Instead we can use UUID built in functions in ESQL / Java utils functions for unique value. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu May 03, 2012 11:55 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
mqbrks wrote: |
lancelotlinc wrote: |
gecs wrote: |
I use a SOAPInput node and the "replyIdentifier" property doesn't help me so much... |
SOAPInput replyIdentifier would make a great CorrelId. Why do you not want to use it? It is unique. |
ReplyIdentifier is not unique.....Instead we can use UUID built in functions in ESQL / Java utils functions for unique value. |
ReplyIdentifier is unique within the transaction set of a message flow, which satisfies most Request/Reply requirements.
If I have three transactions in-flight at the same time, the right reply will get to the right MQGet node.
Also consider that Reply-To-Qmgr field increases the uniqueness. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu May 03, 2012 12:11 pm Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
gecs |
Posted: Thu May 03, 2012 12:27 pm Post subject: |
|
|
 Acolyte
Joined: 14 Nov 2007 Posts: 58
|
lancelotlinc wrote: |
gecs wrote: |
I use a SOAPInput node and the "replyIdentifier" property doesn't help me so much... |
SOAPInput replyIdentifier would make a great CorrelId. Why do you not want to use it? It is unique. |
Hi "lancelotic", you are right, but when I told "replyIdentifier doesn't help me..." is because of "replyIdentifier" property doesn't contains information about QMGR (the name) while in the "correlID" (generated by the QMGR) is present. (using CASTING, as you mentioned).
Regards |
|
Back to top |
|
 |
mapa |
Posted: Thu May 03, 2012 9:52 pm Post subject: |
|
|
 Master
Joined: 09 Aug 2001 Posts: 257 Location: Malmö, Sweden
|
In scenarios SOAP to Legacy ERP, I use the SOAPInput replyIdentifier as MessageId, since the Legacy ERP will automatically put that as CorrelId in the reply.
The reply messageflow (separate, but in same EG) receives it and uses it in the SOAPReply.
Works fine under heavy load.
For one-to-one request/reply that is. |
|
Back to top |
|
 |
jacquesvdm |
Posted: Wed May 16, 2012 11:47 pm Post subject: |
|
|
Apprentice
Joined: 18 Jan 2012 Posts: 29
|
This is how I did it
DECLARE v_corrID CHAR 'any crap I want';
SET v_corrID = v_corrID || REPLICATE('0',(24-LENGTH(v_corrID)));
SET CorrelId = CAST(v_corrID AS BLOB CCSID InputRoot.Properties.CodedCharSetId); |
|
Back to top |
|
 |
|