Author |
Message
|
ovasquez |
Posted: Fri Sep 25, 2009 3:40 pm Post subject: MQReply lost CorrelId |
|
|
 Centurion
Joined: 09 Dec 2005 Posts: 141 Location: Lima, Peru
|
Environement
WMB6.1.0.4
WinXPSP2
Flow
MqInput-->Trace1--->Compute1--->Trace2----MqReply---->Trace3
MQInput, use QL1 and MQReply reply QL2
QL1 and QL2 is in local qmgr.
Compute1:
Code: |
BEGIN
SET OutputRoot.Properties=InputRoot.Properties;
SET OutputRoot.Properties.ReplyIdentifier = InputRoot.MQMD.MsgId;
CREATE NEXTSIBLING OF OutputRoot.Properties DOMAIN 'MQMD';
SET OutputRoot.MQMD.CorrelId=InputRoot.MQMD.MsgId;
SET OutputRoot.MQMD.ReplyToQ=InputRoot.MQMD.ReplyToQ;
RETURN TRUE;
END;
|
Ouput in Trace2
(0x01000000:Name):MQMD = ( ['MQHMD' : 0xb405ec0]
(0x03000000:NameValue):CorrelId = X'414d5120574d42514d33202020202020410bbc4a20115e02' (BLOB) (0x03000000:NameValue):ReplyToQ = 'QL2 ' (CHARACTER)
(0x03000000:NameValue):Format = '' (CHARACTER)
)
Ouput in Trace3
LocalEnviroment[( ['MQROOT' : 0xb1142a0]
(0x01000000:Name):WrittenDestination = (
(0x01000000:Name):MQ = (
(0x01000000:Name):DestinationData = (
(0x03000000:NameValue):queueName = 'QL2' (CHARACTER)
(0x03000000:NameValue):queueManagerName = '' (CHARACTER)
(0x03000000:NameValue):replyIdentifier = X'414d5120574d42514d33202020202020410bbc4a200f8d0e' (BLOB)
(0x03000000:NameValue):msgId = X'414d5120574d42514d33202020202020410bbc4a200f8d0e' (BLOB)
(0x03000000:NameValue):correlId = X'000000000000000000000000000000000000000000000000' (BLOB) (0x03000000:NameValue):GroupId = X'000000000000000000000000000000000000000000000000' (BLOB)
)
)
)
)]
AND::::
Message put in QL2 is ok..but don't have CorrelId.. Why?
 _________________ Oscar Vásquez Flores |
|
Back to top |
|
 |
Vitor |
Posted: Fri Sep 25, 2009 4:28 pm Post subject: Re: MQReply lost CorrelId |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
ovasquez wrote: |
Message put in QL2 is ok..but don't have CorrelId.. Why?
 |
Why would it? What configuration or code have you set to ensure that there's a CorrelId? Are you expecting a CorrelId to be set, or the original MessageId to be used as a CorrelId? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
ovasquez |
Posted: Fri Sep 25, 2009 4:31 pm Post subject: Re: MQReply lost CorrelId |
|
|
 Centurion
Joined: 09 Dec 2005 Posts: 141 Location: Lima, Peru
|
Vitor wrote: |
ovasquez wrote: |
Message put in QL2 is ok..but don't have CorrelId.. Why?
 |
Why would it? What configuration or code have you set to ensure that there's a CorrelId? Are you expecting a CorrelId to be set, or the original MessageId to be used as a CorrelId? |
Yes i use original MsgId ...
Code: |
SET OutputRoot.MQMD.CorrelId=InputRoot.MQMD.MsgId; |
_________________ Oscar Vásquez Flores |
|
Back to top |
|
 |
Vitor |
Posted: Fri Sep 25, 2009 4:40 pm Post subject: Re: MQReply lost CorrelId |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
ovasquez wrote: |
Yes i use original MsgId ...
Code: |
SET OutputRoot.MQMD.CorrelId=InputRoot.MQMD.MsgId; |
|
You did say that didn't you...
What report options are set? Why are you not setting MQRO_COPY_MSG_ID_TO_CORREL_ID but using code? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
ovasquez |
Posted: Fri Sep 25, 2009 4:56 pm Post subject: Re: MQReply lost CorrelId |
|
|
 Centurion
Joined: 09 Dec 2005 Posts: 141 Location: Lima, Peru
|
Vitor wrote: |
ovasquez wrote: |
Yes i use original MsgId ...
Code: |
SET OutputRoot.MQMD.CorrelId=InputRoot.MQMD.MsgId; |
|
You did say that didn't you...
What report options are set? Why are you not setting MQRO_COPY_MSG_ID_TO_CORREL_ID but using code? |
Ok i change my code:
Code: |
BEGIN
SET OutputRoot.Properties=InputRoot.Properties;
CREATE NEXTSIBLING OF OutputRoot.Properties DOMAIN 'MQMD';
SET OutputRoot.MQMD.Report=0;
SET OutputRoot.MQMD.ReplyToQ=InputRoot.MQMD.ReplyToQ;
--MQRO_COPY_MSG_ID_TO_CORREL_ID =0
RETURN TRUE;
END;
|
i display message in QL2 and CorrelId is X'000000000000000000000000' _________________ Oscar Vásquez Flores |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Sep 25, 2009 9:01 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Which version of Broker?
Which Version of MQ?
I suspect you simply did not set the option on the MQOutput node correctly or did not use an MQReply node...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
ovasquez |
Posted: Mon Sep 28, 2009 6:32 am Post subject: |
|
|
 Centurion
Joined: 09 Dec 2005 Posts: 141 Location: Lima, Peru
|
fjb_saper wrote: |
Which version of Broker?
Which Version of MQ?
I suspect you simply did not set the option on the MQOutput node correctly or did not use an MQReply node...
Have fun  |
I use MQReply....
With MQOutput work fine...
Environement
WMB6.1.0.4
WMQ 6.0.2.6
WinXPSP2
Flow
MqInput-->Trace1--->Compute1--->Trace2----MqReply---->Trace3 _________________ Oscar Vásquez Flores |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Sep 28, 2009 8:55 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
With the MQReply as the next node you have to set the correlationId into the messageID field of the MQMD (if no report option is set).
Try it out and let us know the result...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Luke |
Posted: Mon Sep 28, 2009 9:10 am Post subject: |
|
|
Centurion
Joined: 10 Nov 2008 Posts: 128 Location: UK
|
Code: |
SET OutputRoot.MQMD.Report = MQRO_COPY_MSG_ID_TO_CORREL_ID; |
(Edit - typo)
That works for me - no code required to set it in the compute node.
If you want to manually set it in your esql, I think you have to specify a different report option - MQRO_PASS_CORREL_ID
How come when you have MQInput --> Compute --> MQReply, you are creating a new MQMD? ... most people would copy the header in this scenario, then change the fields they specifically need to change ... seems unusual to me to create a new MQMD. |
|
Back to top |
|
 |
ovasquez |
Posted: Mon Sep 28, 2009 9:17 am Post subject: |
|
|
 Centurion
Joined: 09 Dec 2005 Posts: 141 Location: Lima, Peru
|
fjb_saper wrote: |
With the MQReply as the next node you have to set the correlationId into the messageID field of the MQMD (if no report option is set).
Try it out and let us know the result...  |
Thanks!
With this code MQReply copy CorrelId for MessageReply:
Code: |
SET OutputRoot.Properties=InputRoot.Properties;
CREATE NEXTSIBLING OF OutputRoot.Properties DOMAIN 'MQMD';
SET OutputRoot.MQMD.MsgId=InputRoot.MQMD.MsgId;
SET OutputRoot.MQMD.ReplyToQ=InputRoot.MQMD.ReplyToQ;
RETURN TRUE;
|
but with this code MQReply don't copy CorrelID for MessageReply:
Code: |
SET OutputRoot.Properties=InputRoot.Properties;
CREATE NEXTSIBLING OF OutputRoot.Properties DOMAIN 'MQMD';
SET OutputRoot.MQMD.CorrelId=InputRoot.MQMD.MsgId;
SET OutputRoot.MQMD.ReplyToQ=InputRoot.MQMD.ReplyToQ;
RETURN TRUE;
|
I thinks is for Message Broker design ..¿? _________________ Oscar Vásquez Flores |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Sep 28, 2009 9:22 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Default behavior with no report options of the MQReply node is to populate the correlationId with the messageId on the MQMD of the InputRoot at the node.
Working as designed...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
ovasquez |
Posted: Mon Sep 28, 2009 9:34 am Post subject: |
|
|
 Centurion
Joined: 09 Dec 2005 Posts: 141 Location: Lima, Peru
|
Luke wrote: |
Code: |
SET OutputRoot.MQMD.Report = MQRO_COPY_MSG_ID_TO_CORREL_ID; |
(Edit - typo)
That works for me - no code required to set it in the compute node.
If you want to manually set it in your esql, I think you have to specify a different report option - MQRO_PASS_CORREL_ID
How come when you have MQInput --> Compute --> MQReply, you are creating a new MQMD? ... most people would copy the header in this scenario, then change the fields they specifically need to change ... seems unusual to me to create a new MQMD. |
This code, too copy correlId for MQReply.
Code: |
BEGIN
SET OutputRoot.Properties=InputRoot.Properties;
CREATE NEXTSIBLING OF OutputRoot.Properties DOMAIN 'MQMD';
SET OutputRoot.MQMD.CorrelId=InputRoot.MQMD.MsgId;
SET OutputRoot.MQMD.Report = MQRO_PASS_CORREL_ID;
SET OutputRoot.MQMD.ReplyToQ=InputRoot.MQMD.ReplyToQ;
RETURN TRUE;
END;
|
_________________ Oscar Vásquez Flores |
|
Back to top |
|
 |
Luke |
Posted: Mon Sep 28, 2009 9:45 am Post subject: |
|
|
Centurion
Joined: 10 Nov 2008 Posts: 128 Location: UK
|
ovasquez wrote: |
Luke wrote: |
Code: |
SET OutputRoot.MQMD.Report = MQRO_COPY_MSG_ID_TO_CORREL_ID; |
(Edit - typo)
That works for me - no code required to set it in the compute node.
If you want to manually set it in your esql, I think you have to specify a different report option - MQRO_PASS_CORREL_ID
How come when you have MQInput --> Compute --> MQReply, you are creating a new MQMD? ... most people would copy the header in this scenario, then change the fields they specifically need to change ... seems unusual to me to create a new MQMD. |
This code, don't copy correlId for MQReply.
i test with MQRO_COPY_MSG_ID_TO_CORREL_ID and MQRO_PASS_CORREL_ID
Code: |
BEGIN
SET OutputRoot.Properties=InputRoot.Properties;
CREATE NEXTSIBLING OF OutputRoot.Properties DOMAIN 'MQMD';
SET OutputRoot.MQMD.Report = MQRO_COPY_MSG_ID_TO_CORREL_ID;
SET OutputRoot.MQMD.ReplyToQ=InputRoot.MQMD.ReplyToQ;
RETURN TRUE;
END;
|
|
It would if you populated the MsgId so that there was one there to copy to the CorrelId ... i.e.
Code: |
BEGIN
SET OutputRoot.Properties=InputRoot.Properties;
CREATE NEXTSIBLING OF OutputRoot.Properties DOMAIN 'MQMD';
SET OutputRoot.MQMD.MsgId=InputRoot.MQMD.MsgId;
SET OutputRoot.MQMD.Report = MQRO_COPY_MSG_ID_TO_CORREL_ID;
SET OutputRoot.MQMD.ReplyToQ=InputRoot.MQMD.ReplyToQ;
RETURN TRUE;
END; |
Or if you set the MsgId to the CorrelId and set the other report option, i.e.:
Code: |
BEGIN
SET OutputRoot.Properties=InputRoot.Properties;
CREATE NEXTSIBLING OF OutputRoot.Properties DOMAIN 'MQMD';
SET OutputRoot.MQMD.CorrelId =InputRoot.MQMD.MsgId;
SET OutputRoot.MQMD.Report = MQRO_PASS_CORREL_ID;
SET OutputRoot.MQMD.ReplyToQ=InputRoot.MQMD.ReplyToQ;
RETURN TRUE;
END; |
There are lots of ways you can do it ... but as fjb_saper says - it's the default behaviour, so not setting anything explicitly works too, and that's got to be the easiest way! |
|
Back to top |
|
 |
ovasquez |
Posted: Mon Sep 28, 2009 9:49 am Post subject: |
|
|
 Centurion
Joined: 09 Dec 2005 Posts: 141 Location: Lima, Peru
|
Yes, Thanks Luke
Your option work fine, i fix my post... _________________ Oscar Vásquez Flores |
|
Back to top |
|
 |
Luke |
Posted: Mon Sep 28, 2009 9:53 am Post subject: |
|
|
Centurion
Joined: 10 Nov 2008 Posts: 128 Location: UK
|
Ah, OK
Cheers |
|
Back to top |
|
 |
|