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?
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?
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.
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.