diff --git a/build/version.props b/build/version.props index d705cb4..6f4fc75 100644 --- a/build/version.props +++ b/build/version.props @@ -2,7 +2,7 @@ 2 2 - 0 + 1 $(VersionMajor).$(VersionMinor).$(VersionPatch) diff --git a/src/DotNetCore.CAP/Diagnostics/DiagnosticListenerExtensions.cs b/src/DotNetCore.CAP/Diagnostics/DiagnosticListenerExtensions.cs index e833a8e..da0cc0c 100644 --- a/src/DotNetCore.CAP/Diagnostics/DiagnosticListenerExtensions.cs +++ b/src/DotNetCore.CAP/Diagnostics/DiagnosticListenerExtensions.cs @@ -107,6 +107,7 @@ namespace DotNetCore.CAP.Diagnostics { if (@this.IsEnabled(CapBeforePublish)) { + eventData.Headers = new TracingHeaders(); @this.Write(CapBeforePublish, eventData); } } @@ -115,6 +116,7 @@ namespace DotNetCore.CAP.Diagnostics { if (@this.IsEnabled(CapAfterPublish)) { + eventData.Headers = new TracingHeaders(); @this.Write(CapAfterPublish, eventData); } } @@ -123,6 +125,7 @@ namespace DotNetCore.CAP.Diagnostics { if (@this.IsEnabled(CapErrorPublish)) { + eventData.Headers = new TracingHeaders(); @this.Write(CapErrorPublish, eventData); } } @@ -135,6 +138,7 @@ namespace DotNetCore.CAP.Diagnostics { if (@this.IsEnabled(CapBeforeConsume)) { + eventData.Headers = new TracingHeaders(); @this.Write(CapBeforeConsume, eventData); } @@ -145,6 +149,7 @@ namespace DotNetCore.CAP.Diagnostics { if (@this.IsEnabled(CapAfterConsume)) { + eventData.Headers = new TracingHeaders(); @this.Write(CapAfterConsume, eventData); } } @@ -153,6 +158,7 @@ namespace DotNetCore.CAP.Diagnostics { if (@this.IsEnabled(CapErrorConsume)) { + eventData.Headers = new TracingHeaders(); @this.Write(CapErrorConsume, eventData); } } diff --git a/src/DotNetCore.CAP/Diagnostics/EventData.Broker.cs b/src/DotNetCore.CAP/Diagnostics/EventData.Broker.cs index b0a6b20..2db1794 100644 --- a/src/DotNetCore.CAP/Diagnostics/EventData.Broker.cs +++ b/src/DotNetCore.CAP/Diagnostics/EventData.Broker.cs @@ -11,7 +11,6 @@ namespace DotNetCore.CAP.Diagnostics string brokerTopicName, string brokerTopicBody) : base(operationId, operation) { - Headers = new TracingHeaders(); BrokerAddress = brokerAddress; BrokerTopicName = brokerTopicName; BrokerTopicBody = brokerTopicBody; diff --git a/src/DotNetCore.CAP/IPublishMessageSender.Base.cs b/src/DotNetCore.CAP/IPublishMessageSender.Base.cs index eb37cfc..cc82be6 100644 --- a/src/DotNetCore.CAP/IPublishMessageSender.Base.cs +++ b/src/DotNetCore.CAP/IPublishMessageSender.Base.cs @@ -147,7 +147,7 @@ namespace DotNetCore.CAP s_diagnosticListener.WritePublishBefore(eventData); - return (operationId, eventData.Headers); + return (operationId, eventData.Headers); //if not enabled diagnostics ,the header will be null } private void TracingAfter(Guid operationId, string topic, string values, DateTimeOffset startTime, TimeSpan du)