1
votes

How do you add the IBM MQ Correlation ID header to a message in WSO2 Integrator?

I have a scenario where I receive a message from MQ, transform the message using a few mediators and calls to backend services, and need to reply with the transformed message to another (MQ) queue using WSO2 Integrator (version 6.1.1). The client receiving the message is expecting to find the same Correlation ID in my reply as in his original message.

IBM tells me the property is this one:

The CorrelationId to be included in the MQMD of a message when put on a queue.

Defined in: MQMessage class

Data Type: String of 24 characters

Syntax: To get: correlid$ = MQMessage.CorrelationId To set: MQMessage.CorrelationId = correlid$

https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q034650_.htm

1
I suspect you can use the JMS_COORELATION_ID for that: docs.wso2.com/display/ESB481/…Jan
Thanks, I will try this and revert.Petteri Pertola
Hi Awan, how would I do that exactly in WSO2 Integrator?Petteri Pertola
@PetteriPertola as Jan mentioned above, you might follow instruction on that link.Awan Biru
Hi Awan, the link above does not provide an example of how to cast to MQMessage. Are you able to show an example? The WSO2 documentation in general is often lacking clear examples.Petteri Pertola

1 Answers

1
votes

It turns out it was an easy solution. The JMS_COORELATION_ID property must be set specifically in the axis2 scope.

So while this works:

<property name="JMS_COORELATION_ID" value="MyCoorelationId" scope="axis2" xmlns:ns="http://org.apache.synapse/xsd"/>

Using any other scope, such as default or transport, does not:

<property name="JMS_COORELATION_ID" value="MyCoorelationId" scope="transport" xmlns:ns="http://org.apache.synapse/xsd"/>
<property name="JMS_COORELATION_ID" value="MyCoorelationId" scope="default" xmlns:ns="http://org.apache.synapse/xsd"/>

Unfortunately the WSO2 documentation is dreadful and does not mention that other scopes do not work. Hope this saves someone time in the future.