In InvokeAsync of the TennantMiddleware this block:
if (correlationId != Guid.Empty)
{
tenantContext.SetCorrelationId(correlationId);
}
needs to be updated to this:
if (correlationId != Guid.Empty)
{
tenantContext.SetCorrelationId(correlationId);
context.Items[KeyNameCorrelationId] = correlationId.ToString(); // make it accessible to HttpClient handlers
}
This will allow client calls to pass on the correlation id to the next link in the HTTP chain