Correlation IDs
To ensure clarity and a proper implementation, here are some guidelines:
-
Correlation IDs should be unique to each message to ensure traceability and prevent collisions. It is recommended to use UUIDv4 IDs for generating these IDs.
-
For Inbound Messages:
- When a Connector publishes a message to SyncHive, it should generate a new Correlation ID. This Correlation ID should be included in the request sent to SyncHive. The same Correlation ID should be used for all log entries related to this message, ensuring consistent tracking throughout the lifecycle of the message.
-
For Outbound Messages:
- When a Connector receives a message from SyncHive, it should extract the Correlation ID from the message. The Connector should then use this Correlation ID for all subsequent log entries related to this message.
Examples
Inbound Message
When publishing a message to SyncHive, we should:
- Generate a UUIDv4 Correlation ID:
123e4567-e89b-12d3-a456-426614174000
- Include this Correlation ID in the request payload to SyncHive
- Log all actions and events related to this message using the same Correlation ID.
Request payload to SyncHive Example
{
"schemaName": "limber",
"schemaVersion": "2.1.0",
"shapeName": "Product",
"dataId": {
// ... (Omitted)
},
"dataAction": "PUBLISH",
"mode": "LIVE",
"integrationKey": "Example Integration",
"data": {
// ... (Omitted)
},
"correlationId": "123e4567-e89b-12d3-a456-426614174000"
}
Outbound Message
- Extract the Correlation ID from the received message:
123e4567-e89b-12d3-a456-426614174000
- Use this Correlation ID for all log entries related to this message.
Request payload from SyncHive Example
{
"schemaName": "limber",
"schemaVersion": "2.1.0",
"shapeName": "Product",
"dataId": {
// ... (Omitted)
},
"dataAction": "PUBLISH",
"mode": "LIVE",
"integrationKey": "Example Integration",
"data": {
// ... (Omitted)
},
"correlationId": "123e4567-e89b-12d3-a456-426614174000"
}