Context factory, implementing ICorrelationContextFactory
, is responsible for reading correlation out
of request's HttpContext
.
CorrelationContext CreateContext(HttpContext httpContext)
Correlation Context Factory returns (abstract) CorrelationContext
, which is then extended by following types:
EmptyCorrelationContext
: No correlation received nor generated - we don't know correlationGeneratedCorrelationContext
: No correlation received, but generated using configured factory methodRequestCorrelationContext
: Correlation ID receivedInvalidCorrelationContext
: Correlation received, but invalid
Correlation emitter, implementing ICorrelationEmitter
, is responsible for forwarding Correlation ID
to subsequent requests.
Task Emit(HttpContext httpContext, CorrelationContext correlationContext)
Correlation validator, implementing ICorrelationValidator
, (if registered) checks whether incoming raw
value of correlation header is valid.
If value is invalid InvalidCorrelationContext
is created by context factory instead of RequestCorrelationContext
.
ValidationResult Validate(string? value);
Correlator HTTP Message Handler extends DelegatingHandler
.
Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)