Skip to content

aimenux/CorrelationIdHeaderDemo

Repository files navigation

.NET

CorrelationIdHeaderDemo

Passing correlation id in request/response headers

In this repo, i m exploring various ways in order to :

📌 pass correlation id in request/response headers

📌 propagate correlation id across http calls

📌 use correlation id in trace identifier

📌 enrich logs with correlation id

1️⃣ Example01 use a custom middleware, a custom delegation handler and a custom log enricher

2️⃣ Example02 use a custom middleware and a custom delegation handler based on built-in accessor class

3️⃣ Example03 use a custom middleware and a custom delegation handler based on a custom accessor class

4️⃣ Example04 use CorrelationId middelware and a custom delegation handler

Tools : vs22, net 6.0, web api, serilog, integration-testing, fluent-assertions, nsubstitute