Browse Source
Skip to set `CorrelationId ` if current value is `null`.
Resolve #21419
pull/21427/head
maliming
2 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
3 changed files with
14 additions and
3 deletions
-
framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs
-
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/ClientProxying/ClientProxyBase.cs
-
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs
|
|
|
@ -132,7 +132,10 @@ public abstract class DistributedEventBusBase : EventBusBase, IDistributedEventB |
|
|
|
Serialize(eventData), |
|
|
|
Clock.Now |
|
|
|
); |
|
|
|
outgoingEventInfo.SetCorrelationId(CorrelationIdProvider.Get()!); |
|
|
|
if (CorrelationIdProvider.Get() != null) |
|
|
|
{ |
|
|
|
outgoingEventInfo.SetCorrelationId(CorrelationIdProvider.Get()!); |
|
|
|
} |
|
|
|
await eventOutbox.EnqueueAsync(outgoingEventInfo); |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
@ -309,7 +309,11 @@ public class ClientProxyBase<TService> : ITransientDependency |
|
|
|
} |
|
|
|
|
|
|
|
//CorrelationId
|
|
|
|
requestMessage.Headers.Add(AbpCorrelationIdOptions.Value.HttpHeaderName, CorrelationIdProvider.Get()); |
|
|
|
var correlationId = CorrelationIdProvider.Get(); |
|
|
|
if (correlationId != null) |
|
|
|
{ |
|
|
|
requestMessage.Headers.Add(AbpCorrelationIdOptions.Value.HttpHeaderName, correlationId); |
|
|
|
} |
|
|
|
|
|
|
|
//TenantId
|
|
|
|
if (CurrentTenant.Id.HasValue) |
|
|
|
|
|
|
|
@ -126,7 +126,11 @@ public class ApiDescriptionFinder : IApiDescriptionFinder, ITransientDependency |
|
|
|
protected virtual void AddHeaders(HttpRequestMessage requestMessage) |
|
|
|
{ |
|
|
|
//CorrelationId
|
|
|
|
requestMessage.Headers.Add(AbpCorrelationIdOptions.HttpHeaderName, CorrelationIdProvider.Get()); |
|
|
|
var correlationId = CorrelationIdProvider.Get(); |
|
|
|
if (correlationId != null) |
|
|
|
{ |
|
|
|
requestMessage.Headers.Add(AbpCorrelationIdOptions.HttpHeaderName, correlationId); |
|
|
|
} |
|
|
|
|
|
|
|
//TenantId
|
|
|
|
if (CurrentTenant.Id.HasValue) |
|
|
|
|