https://github.com/aimenux/correlationidheaderdemo
Passing correlation id in request/response headers
https://github.com/aimenux/correlationidheaderdemo
correlation-id fluent-assertions integration-testing middleware net60 nsubstitute serilog webapi xunit
Last synced: 5 days ago
JSON representation
Passing correlation id in request/response headers
- Host: GitHub
- URL: https://github.com/aimenux/correlationidheaderdemo
- Owner: aimenux
- License: mit
- Created: 2022-08-02T23:29:13.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-06-03T21:26:08.000Z (about 1 year ago)
- Last Synced: 2025-11-22T07:05:50.099Z (7 months ago)
- Topics: correlation-id, fluent-assertions, integration-testing, middleware, net60, nsubstitute, serilog, webapi, xunit
- Language: C#
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/aimenux/CorrelationIdHeaderDemo/actions/workflows/ci.yml)
# CorrelationIdHeaderDemo
```
Passing correlation id in request/response headers
```
> In this repo, i m exploring various ways in order to :
>>
>> :pushpin: pass correlation id in request/response headers
>>
>> :pushpin: propagate correlation id across http calls
>>
>> :pushpin: use correlation id in trace identifier
>>
>> :pushpin: enrich logs with correlation id
>
>
> :one: `Example01` use a custom middleware, a custom delegation handler and a custom log enricher
>
> :two: `Example02` use a custom middleware and a custom delegation handler based on [built-in accessor class](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-context)
>
> :three: `Example03` use a custom middleware and a custom delegation handler based on a [custom accessor class](https://docs.microsoft.com/en-us/dotnet/api/system.threading.asynclocal-1)
>
> :four: `Example04` use [CorrelationId middelware](https://github.com/stevejgordon/CorrelationId) and a custom delegation handler
>
**`Tools`** : vs22, net 6.0, web api, serilog, integration-testing, fluent-assertions, nsubstitute