Skip to main content

Correlation IDs

A correlationId (also called a message journey ID) is a unique identifier for a message that acts like a tracking number across the message’s entire lifecycle. It enables you to search for and monitor the status of a message in SyncHive, with all related events and messages grouped into a single message journey.

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:

  1. Generate a UUIDv4 Correlation ID: 123e4567-e89b-12d3-a456-426614174000
  2. Include this Correlation ID in the request payload to SyncHive
  3. 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

  1. Extract the Correlation ID from the received message: 123e4567-e89b-12d3-a456-426614174000
  2. 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"
}