cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

This product reached the end of support date on March 31, 2021.

Capture correlation id for MQ messages

chenjie_zhu22
Inactive

Hi All,

I'm trying to capture the correlation id for MQ messages to help customer quickly identify purepaths with correlation id and vice versa.

I created following sensor, but unfortunately, the value is not a primitive.

Thus, I got the value displayed as "System.Byte[]" instead of a true correlation ID.

I found a similar question a while ago, but hasn't been answered. IBM Message ID as Return Value

Also, using a sequence of accessors to get nested properties is available now per this RFE.

The challenge is that I couldn't see any method in System.Byte which allows me to convert a System.Byte[] type into a String or int type value.

System.Text.Encoding.Default.GetString(System.Byte[]) does the convertion, but this syntax (ie. System.Text.Encoding.Default.GetString(IBM.WMQ.MQMessage.get_CorrelationId())) is not supported in our sensor rules.

Any idea, guys?

Regards

Kevin

4 REPLIES 4

chenjie_zhu22
Inactive

Since Dynatrace can correlate MQ messages with front end transaction with correlation id, I would assume we can extract this value. I just need that one step to display it. Can I have some feedback on this please?

Thanks

Kevin

Babar_Qayyum
DynaMight Leader
DynaMight Leader

Hello Chenjie,

I had discuss this issue also with the Dynatrace Support in the past IBM Message ID as Return Value and you can find the following answer.

The solution proposed in the forum has merit, but due to the limitations of the accessor it did not work.
Another approach could be to create a method in the Application, specifically for your use case, that could utilize com.ibm.mq.MQMessage.getStringProperty("messageId"). Then, this custom made method would return a value. You could use a custom sensor to capture the return value.

Apart from the above, we cannot see other solution.

Regards,

Babar

Thanks Babar. I've thought about this. Maybe we have to go down this route as well if it can't be down from Dynatrace side.

We also have an RFE created.

https://answers.dynatrace.com/idea/175568/rfe-extract-correlationid-from-message-broker-mq-m.html

Hello @Chenjie Z.

This is a good approach. I wanted to vote to your RFE but due to access denied message I could not 🙂

Regards,

Babar