Author |
Message
|
akbardar |
Posted: Fri Oct 11, 2013 6:34 am Post subject: MQMD MsgId is changed - Why |
|
|
Novice
Joined: 05 Apr 2006 Posts: 21 Location: New Haven, CT
|
I need explanation, why is MsgId changing after messages is consumed in SAP.
Message is received from Message Broker MQInput Node in MQ Queue, MsgId is:
414D5120555549444130312020202020524F3E442009BC4D
Then I create a SAP Control Record and take backup of the MQ Message, and MQ MsgId is still:
414D5120555549444130312020202020524F3E442009BC4D
But, When Message goes successfully through the SAP Request Node, then the MsgId is changed as:
Before SAP Node: 414D5120555549444130312020202020524F3E442009BC4D
After SAP Node: 414D5120555549444130312020202020524F3E4420088E0D
As you can MsgId is slightly different, any idea why?
Regards,
AkBar Dar |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Oct 11, 2013 6:45 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Put a Trace node before and a Trace node after the SAPRequest node to demonstrate your point.
Code: |
Root:
${Root}
===
LocalEnvironment:
${LocalEnvironment}
===
Environment:
${Environment}
===
ExceptionList:
${ExceptionList}
===
${CURRENT_TIMESTAMP}
======================= |
_________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
akbardar |
Posted: Fri Oct 11, 2013 8:17 am Post subject: |
|
|
Novice
Joined: 05 Apr 2006 Posts: 21 Location: New Haven, CT
|
Following is the result of your code and environment:
=======================
Before SAP Request Root:
( ['MQROOT' : 0x11038f130]
(0x01000000:Name ):Properties = ( ['MQPROPERTYPARSER' : 0x110f8d5f0]
(0x03000000:NameValue):MessageSet = NULL
(0x03000000:NameValue):MessageType = NULL
(0x03000000:NameValue):MessageFormat = NULL
(0x03000000:NameValue):Encoding = NULL
(0x03000000:NameValue):CodedCharSetId = NULL
(0x03000000:NameValue):Transactional = NULL
(0x03000000:NameValue):Persistence = NULL
(0x03000000:NameValue):CreationTime = NULL
(0x03000000:NameValue):ExpirationTime = NULL
(0x03000000:NameValue):Priority = NULL
(0x03000000:NameValue):ReplyIdentifier = NULL
(0x03000000:NameValue):ReplyProtocol = 'MQ' (CHARACTER)
(0x03000000:NameValue):Topic = NULL
(0x03000000:NameValue):ContentType = NULL
(0x03000000:NameValue):IdentitySourceType = NULL
(0x03000000:NameValue):IdentitySourceToken = NULL
(0x03000000:NameValue):IdentitySourcePassword = NULL
(0x03000000:NameValue):IdentitySourceIssuedBy = NULL
(0x03000000:NameValue):IdentityMappedType = NULL
(0x03000000:NameValue):IdentityMappedToken = NULL
(0x03000000:NameValue):IdentityMappedPassword = NULL
(0x03000000:NameValue):IdentityMappedIssuedBy = NULL
)
(0x01000000:Folder):XMLNSC = ( ['xmlnsc' : 0x11163f3b0]
(0x01000000:Folder):SapZisuHvcaTroubleTicket = (
(0x01000000:Folder):SapZisuHvcaTroubleTicketIDocBO = (
(0x01000000:Folder):SapIDocControlRecord = (
(0x03000000:PCDataField):TABNAM = 'EDI_DC40' (CHARACTER)
(0x03000000:PCDataField):MANDT = '120' (CHARACTER)
(0x03000000:PCDataField):IDOCTYP = 'ZISU_HVCA_TROUBLE_TICKET' (CHARACTER)
(0x03000000:PCDataField):MESTYP = 'ZISU_HVCA_TRBL_TCKT_IN' (CHARACTER)
(0x03000000:PCDataField):SNDPRT = 'LS' (CHARACTER)
(0x03000000:PCDataField):SNDPRN = 'HCVCON' (CHARACTER)
(0x03000000:PCDataField):SNDPOR = 'HVCAPORT' (CHARACTER)
(0x03000000:PCDataField):RCVPRT = 'LS' (CHARACTER)
(0x03000000:PCDataField):RCVPRN = 'DEVCLNT120' (CHARACTER)
(0x03000000:PCDataField):RCVPOR = 'SAP' (CHARACTER)
)
(0x01000000:Folder):SapZisuHvcaTroubleTicketDataRecord = (
(0x01000000:Folder):SapZisuHvcaTroubleTicketZ2isuHvcaTrblTckt000 = (
(0x03000000:PCDataField):ACCOUNTNUMBER = '100000007085' (CHARACTER)
(0x03000000:PCDataField):NOTIFTYPE = 'ZUN1' (CHARACTER)
(0x03000000:PCDataField):NOTIFGROUP = 'TR0000' (CHARACTER)
(0x03000000:PCDataField):NOTIFCODE = '0010' (CHARACTER)
(0x03000000:PCDataField):CLASS = '0017' (CHARACTER)
(0x03000000:PCDataField):ACTIVITY = '0050' (CHARACTER)
)
)
)
)
)
)
===
LocalEnvironment:
( ['MQROOT' : 0x111646550]
(0x01000000:Name):Adapter = (
(0x03000000:NameValue):MethodName = 'executeSapZisuHvcaTroubleTicket' (CHARACTER)
)
(0x01000000:Name):WrittenDestination = (
(0x01000000:Name):MQ = (
(0x01000000:Name):DestinationData = (
(0x03000000:NameValue):queueName = 'HVCATOSAP.QL.TICKETS.CAPTURE.POST.FLOW' (
CHARACTER)
(0x03000000:NameValue):queueManagerName = '' (CHARACTER)
(0x03000000:NameValue):replyIdentifier = X'414d5120555549444130312020202020524f3e44
20088b16' (BLOB)
(0x03000000:NameValue):msgId = X'414d5120555549444130312020202020524f3e44
20088b16' (BLOB)
(0x03000000:NameValue):correlId = X'0000000000000000000000000000000000000000
00000000' (BLOB)
(0x03000000:NameValue):GroupId = X'0000000000000000000000000000000000000000
00000000' (BLOB)
)
)
)
)
===
Environment:
( ['MQROOT' : 0x11038fb30]
(0x01000000:Name):Variables = (
(0x03000000:NameValue):errorSource = 'HCVtoSAP:SAPHCV_BrokerToSAPFlow_Compute' (CHARACTE
R)
)
)
===
ExceptionList:
===
2013-10-11 12:12:02.757192
=======================
After SAP Request Root:
( ['GENERICROOT' : 0x112c657d0]
(0x01000000:Name ):Properties = ( ['MQPROPERTYPARSER' : 0x1138ead50]
(0x03000000:NameValue):MessageSet = NULL
(0x03000000:NameValue):MessageType = NULL
(0x03000000:NameValue):MessageFormat = NULL
(0x03000000:NameValue):Encoding = NULL
(0x03000000:NameValue):CodedCharSetId = NULL
(0x03000000:NameValue):Transactional = NULL
(0x03000000:NameValue):Persistence = NULL
(0x03000000:NameValue):CreationTime = NULL
(0x03000000:NameValue):ExpirationTime = NULL
(0x03000000:NameValue):Priority = NULL
(0x03000000:NameValue):ReplyIdentifier = NULL
(0x03000000:NameValue):ReplyProtocol = 'MQ' (CHARACTER)
(0x03000000:NameValue):Topic = NULL
(0x03000000:NameValue):ContentType = NULL
(0x03000000:NameValue):IdentitySourceType = NULL
(0x03000000:NameValue):IdentitySourceToken = NULL
(0x03000000:NameValue):IdentitySourcePassword = NULL
(0x03000000:NameValue):IdentitySourceIssuedBy = NULL
(0x03000000:NameValue):IdentityMappedType = NULL
(0x03000000:NameValue):IdentityMappedToken = NULL
(0x03000000:NameValue):IdentityMappedPassword = NULL
(0x03000000:NameValue):IdentityMappedIssuedBy = NULL
)
(0x01000000:Folder):DataObject = ( ['xmlnsc' : 0x112c66ad0]
(0x01000000:Folder)http://www.ibm.com/xmlns/prod/websphere/j2ca/sap/sapzisuhvcatroubleticket:SapZisuHvcaTroubleTicket = (
(0x03000000:PCDataField):SAPTransactionID = '0ADA1FA2116A525823530F0B' (CHARACTER)
)
)
)
===
LocalEnvironment:
( ['MQROOT' : 0x112c66df0]
(0x01000000:Name):Adapter = (
(0x03000000:NameValue):MethodName = 'executeSapZisuHvcaTroubleTicket' (CHARACTER)
)
(0x01000000:Name):WrittenDestination = (
(0x01000000:Name):MQ = (
(0x01000000:Name):DestinationData = (
(0x03000000:NameValue):queueName = 'HVCATOSAP.QL.TICKETS.CAPTURE.POST.FLOW' (CHARACTER)
(0x03000000:NameValue):queueManagerName = '' (CHARACTER)
(0x03000000:NameValue):replyIdentifier = X'414d5120555549444130312020202020524f3e4420088b16' (BLOB)
(0x03000000:NameValue):msgId = X'414d5120555549444130312020202020524f3e4420088b16' (BLOB)
(0x03000000:NameValue):correlId = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000:NameValue):GroupId = X'000000000000000000000000000000000000000000000000' (BLOB)
)
)
)
)
===
Environment:
( ['MQROOT' : 0x11038fb30]
(0x01000000:Name):Variables = (
(0x03000000:NameValue):errorSource = 'HCVtoSAP:SAPHCV_BrokerToSAPFlow_Compute' (CHARACTER)
)
)
===
ExceptionList:
===
2013-10-11 12:12:03.787144
======================= |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Oct 11, 2013 8:55 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Why don't you just save the whole of the Input MQMD into the Environment (preservice the Parser domain naturally) and then restore it just before the MQOutput Node?
I wouldn't use the LocalEnvironment for this as it is used by the SAP nodes. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Oct 11, 2013 9:16 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
smdavies has a good point. If you intend on reusing the original message Id you need to store it in Environment, not LocalEnvironment. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
akbardar |
Posted: Fri Oct 11, 2013 9:19 am Post subject: |
|
|
Novice
Joined: 05 Apr 2006 Posts: 21 Location: New Haven, CT
|
I know that I can save the MsgId, but, I was wondering that Why would SAP Request Node change the MsgId.
Regards,
AkBar Dar |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Oct 11, 2013 9:21 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
akbardar wrote: |
I know that I can save the MsgId, but, I was wondering that Why would SAP Request Node change the MsgId. |
Because
Code: |
IF MsgTree.MQMD.Report contains MQRO_PASS_MSG_ID THEN
MQMD.MsgId = MsgTree.MQMD.MsgId;
ELSE
MQMD.MsgId = MQMI_NONE; |
Try setting MsgTree.MQMD.Report with MQRO_PASS_MSG_ID. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Oct 11, 2013 9:31 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
I also notice that there is no MQMD present in your Trace. If you do not pass any MQMD, the Output node will create a new MQMD with a new MsgId.
MQMD belongs in OutputRoot.MQMD not OutputLocalEnvironment.
You incorrectly stated that the MQMD.MsgId changed; but no MQMD is present before or after your SAPRequest node. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Oct 11, 2013 9:34 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Try the SAP sample.
Quote: |
This sample demonstrates how to use two SAP nodes, the SAPInput node and the SAPReply node, to allow a message flow application to act as a synchronous BAPI. This sample differs from the SAP callout to a synchronous system sample because it shows how to use the SAPReply node in a different flow by storing the SAP reply identifier as a WebSphere MQ message identifier and correlation identifier. The customer details are received by the SAPInput node in the form of BAPI import parameters, which are sent, through WebSphere MQ, to another message flow where they are processed by the Compute nodes. A response with the export parameters of the BAPI is sent to another message flow (through WebSphere MQ), which uses the SAPReply node to send the export parameters back to the SAP system. |
_________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Oct 11, 2013 9:38 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
lancelotlinc wrote: |
Try the SAP sample.
Quote: |
This sample demonstrates how to use two SAP nodes, the SAPInput node and the SAPReply node, to allow a message flow application to act as a synchronous BAPI. This sample differs from the SAP callout to a synchronous system sample because it shows how to use the SAPReply node in a different flow by storing the SAP reply identifier as a WebSphere MQ message identifier and correlation identifier. The customer details are received by the SAPInput node in the form of BAPI import parameters, which are sent, through WebSphere MQ, to another message flow where they are processed by the Compute nodes. A response with the export parameters of the BAPI is sent to another message flow (through WebSphere MQ), which uses the SAPReply node to send the export parameters back to the SAP system. |
|
How would that help with a request going TO SAP, rather than one COMING FROM SAP? |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Oct 11, 2013 9:41 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
mqjeff wrote: |
How would that help with a request going TO SAP, rather than one COMING FROM SAP? |
It demonstrates how to preserve the message Id. The OP seems new to the concept of Environment tree or how to tell the Output node to preserve the original Id. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
akbardar |
Posted: Fri Oct 11, 2013 9:50 am Post subject: |
|
|
Novice
Joined: 05 Apr 2006 Posts: 21 Location: New Haven, CT
|
I got it, why the MQHD is not there, during the construction of SAP control Record, I never copied the Message Header. I created the Control Record first on the OutputRoot then appended the the InputRoot as followed:
set OutputRoot.XMLNSC.SapZisuHvcaTroubleTicket.SapZisuHvcaTroubleTicketIDocBO.SapZisuHvcaTroubleTicketDataRecord = InputRoot.XMLNSC.SapZisuHvcaTroubleTicket.SapZisuHvcaTroubleTicketIDocBO.SapZisuHvcaTroubleTicketDataRecord;
That's my fault.
Thanks,
AkBar Dar
UIL
New Haven, CT |
|
Back to top |
|
 |
|