Loading
Salesforce から送信されるメールは、承認済ドメインからのみとなります続きを読む

How to Set Custom Correlation Id for Flows with HTTP Endpoint in Mule 4

公開日: Aug 5, 2025
タスク

GOAL

You want to trace the messages flowing through your Mule 4 application using a single unique Id. In many cases, you intend to trace the messages across Multiple applications which can be traced in application logs using an unique Id. How to achieve this?

ステップ

By design, Correlation Ids cannot be changed within a flow in Mule 4 applications and can be set only at source. This ID is part of the Event Context and is generated as soon as the message is received by the application. When a HTTP Request is received, the request is inspected for "X-Correlation-Id" header.

  • If "X-Correlation-Id" header is present, HTTP connector uses this as the Correlation Id.
  • If "X-Correlation-Id" header is NOT present, a Correlation Id is randomly generated.

For Incoming HTTP Requests:
In order to set a custom Correlation Id, the client invoking the HTTP request must set "X-Correlation-Id" header. This will ensure that the Mule Flow uses this Correlation Id.

For Outgoing HTTP Requests:
You can also propagate the existing Correlation Id to downstream APIs. By default, all outgoing HTTP Requests send "X-Correlation-Id" header. However, you can choose to set a different value to "X-Correlation-Id" header or set "Send Correlation Id" to NEVER.
Refer documentation.

ナレッジ記事番号

001116575

 
読み込み中
Salesforce Help | Article