Posted: Wed Aug 05, 2015 9:07 am Post subject: how to set corelation_id in esql ?
Newbie
Joined: 05 Aug 2015 Posts: 1
DECLARE CORRELATION_ID CHARACTER 'Input';
SET OutputRoot.MQMD.CorrelId=CAST(CORRELATION_ID AS BLOB CCSID 819);
I have above code set correlation id is it correct?
Posted: Wed Aug 05, 2015 9:16 am Post subject: Re: how to set corelation_id in esql ?
Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
kiran.bhujbal wrote:
I have above code set correlation id is it correct?
As a best practice the correlation id should be the msgid from the message that you're correlating with. It shouldn't be any kind of externally significant value like "Input", or an account number, or anything similar. It should certainly be distinctive and not sourced from a static character variable.
If you are going to use such a value, you should at least ensure that the value you're putting in is correct for the correlation id data type - the BLOB of "Input" is too short to generate a hex array of the right length.
I assume you want "Input" in 819 because you plan to read all the messages off the queue that have "Input" in the correlation id with an application that runs in an 819 code page. As I've said above, this is a horrible design and this path will only lead you to pain. _________________ Honesty is the best policy.
Insanity is the best defence.
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