Question
Kari Vatjus-Anttila · May 2

Setting a correlation id for a transaction in Ensemble

Hello,

I tried to search the forums but couldn’t find an answer for my need.

I’m building a logging module in Ensemble which could be used to log information about different integrations triggered in our environments. In my first version, the logging module logs straight to messages.log, and it’s working fine for the time being. The logging module is used to log process level information related to integrations with different log levels (info, debug, warn, error, etc.). However, I noticed that I really can’t distinguish between different sessions when looking at the logs because they do not have any unique identifier associated with them.

I’ve tried using

$get($$$JOBSESSIONID)

Which was mentioned in another post, but it returns a blank string at the very beginning of the transaction when a Business Service receives a message. A sessionId is assigned only after the message is delivered forward to a Business Process / Operation. Thus, using the sessionId as a unique identifier in this case is not suitable. Also, I tried to set the sessionId manually immediatly after Ensemble has received the message in a Business Service, but I can’t figure out how to make the Id unique reliably without causing potential collisions.

My question would be: What kind of approach should I consider if I want to associate each transaction with a unique ID (for example GUID) throughout the entire session within Ensemble, starting from the very beginning off the integration when a message is processed e.g. in OnProcessInput() method? If I could assign a unique identifier for each session, I could use this ID to filter log messages with a specific transaction Id while troubleshooting an integration. If I could use $SYSTEM.Util.CreateGUID() somehow in this scenario to generate a reliable unique identifier for each session, that would solve my issue.

Is there any other ID that is assigned to a message received by Ensemble except the sessionId, which is not set until after the message is delivered forward? Is there a way to add custom metadata to each message received by Ensemble for example a GUID?

Thank you for any insight to this matter!

//Kari

Product version: IRIS 2022.1
0
0 55
Discussion (1)2
Log in or sign up to continue