correlid *1) -> null set to B -> B needs to be set to A -> B unable to match if ACE did not store and set to A.
correlid *2) -> F set to F -> F set to F or null or D -> F or null or D unable to match
correlid *3) -> A set to A -> A set to A -> A apllication matches.
It is the responsibility of IIB/ACE to return the message to the originator with the correct correlation ID
All depends on whether IIB / ACE parked the correlation / message id from the incoming message before forwarding that to the app.
If IIB/ACE did not park the correlation ID they need to forward the message with a correlation id matching (the correlation id if not null (or initial), or the messageid if the correlation id is null or initial)
Original Message:
Sent: Mon August 07, 2023 03:37 AM
From: rniew
Subject: How to get the correct CorrID out of a message
Hello Francois.
Thank you for your feedback. We will try it. However, based on your code, also getJMSMessageID would be done (because JMSCorrelID is null) and this is the ID which is considered as bad at the end of the chain.
------------------------------
rniew
Original Message:
Sent: Mon August 07, 2023 01:17 AM
From: Francois Brandelik
Subject: How to get the correct CorrID out of a message
Corrected my previous post to use the JMS relevant method...
------------------------------
Francois Brandelik
Original Message:
Sent: Fri August 04, 2023 09:28 AM
From: rniew
Subject: How to get the correct CorrID out of a message
Thank you for your feedback.
Which MQ/JMS libraries do you include in your Java code? Asking because your code uses getMessageID and not getJMSMessageID. Appears to retrieve the ID from a different part of the message.
Thx
Ric
------------------------------
rniew
Original Message:
Sent: Fri August 04, 2023 08:19 AM
From: Francois Brandelik
Subject: How to get the correct CorrID out of a message
This is where you go wrong:
String[] split = requestHeaders.getJMSMessageID().split("ID:");jmsResponseHeaders.setJMSCorrelationID(split[1]);
Accept that the correlation ID may be null and test for it. Accept that the correlation id can be all "00" (48 of them) and test for it.
Your code should do
if ( message.getCorrelationID == null || message.getCorrelationID () == "Id:000000000000000000000000000000000000000000000000") { //48* 0 response.setCorrelationID(message.getMessageID()); } else { response.setCorrelationID(message.getCorrelationID());}
Hope it helps
------------------------------
Francois Brandelik
Original Message:
Sent: Thu August 03, 2023 10:51 AM
From: rniew
Subject: How to get the correct CorrID out of a message
Hello.
We have a Java ApplicationX running on Cloud in a container on Linux. It was previously running on WebSphere, was using some Webpshere MQ functions and there, all worked fine. Now it was rewritten to run in a container as a Java Application and using Spring Boot IBM JMS Library functions.
It uses JMS function to read from a REQqueueB. The message is originated by a WebSphere Consumer, it is put into a REQqueueA, processed by IIB, written to the REQqueueB, then read by the ApplicationX application and response is written to RESqueueC. Then processed by IIB, written to RESqueueD and read by the WebSphere Consumer.
But at the end the WebSPhere application throws the error WSWS7166E: The JMSCorrelationID of the response message does not match the MessegeID of the intitial request message. But we see the correct correlID in the WebSphere trace which is not equal to the JMSCorrelationID. But it seams correlID it is not in the JMS MRFRH2, but most likely in the MQMD header.
The ApplicationX is doing request/response and uses the following to get and write the Correlation Id to the response message:
String[] split = requestHeaders.getJMSMessageID().split("ID:");
jmsResponseHeaders.setJMSCorrelationID(split[1]);
We use the "getJMSMessageID().split("ID:")" because the JMSCorrelationID is "null" at that point. At least this is what we get out from the Spring Boot IBM JMS Library call. But WebSPhere throws an error for that JMSCorrelationID.
So we think that we somehow use the wrong function to get the correlID. It must be there in the message header. Possibly in the MQMD header. But no idea how to do it. We may need to use another IBM library.
Does someone is experienced in this area and can help?
------------------------------
rniew
IT Spe
IBM
(49171) 722-9761
------------------------------