Commit bd66dc5f authored by Savorboard's avatar Savorboard Committed by GitHub

fixed message enqueue exception in v2.2 (#115)

parent 72161b90
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<VersionMajor>2</VersionMajor> <VersionMajor>2</VersionMajor>
<VersionMinor>2</VersionMinor> <VersionMinor>2</VersionMinor>
<VersionPatch>0</VersionPatch> <VersionPatch>1</VersionPatch>
<VersionQuality></VersionQuality> <VersionQuality></VersionQuality>
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix> <VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix>
</PropertyGroup> </PropertyGroup>
......
...@@ -107,6 +107,7 @@ namespace DotNetCore.CAP.Diagnostics ...@@ -107,6 +107,7 @@ namespace DotNetCore.CAP.Diagnostics
{ {
if (@this.IsEnabled(CapBeforePublish)) if (@this.IsEnabled(CapBeforePublish))
{ {
eventData.Headers = new TracingHeaders();
@this.Write(CapBeforePublish, eventData); @this.Write(CapBeforePublish, eventData);
} }
} }
...@@ -115,6 +116,7 @@ namespace DotNetCore.CAP.Diagnostics ...@@ -115,6 +116,7 @@ namespace DotNetCore.CAP.Diagnostics
{ {
if (@this.IsEnabled(CapAfterPublish)) if (@this.IsEnabled(CapAfterPublish))
{ {
eventData.Headers = new TracingHeaders();
@this.Write(CapAfterPublish, eventData); @this.Write(CapAfterPublish, eventData);
} }
} }
...@@ -123,6 +125,7 @@ namespace DotNetCore.CAP.Diagnostics ...@@ -123,6 +125,7 @@ namespace DotNetCore.CAP.Diagnostics
{ {
if (@this.IsEnabled(CapErrorPublish)) if (@this.IsEnabled(CapErrorPublish))
{ {
eventData.Headers = new TracingHeaders();
@this.Write(CapErrorPublish, eventData); @this.Write(CapErrorPublish, eventData);
} }
} }
...@@ -135,6 +138,7 @@ namespace DotNetCore.CAP.Diagnostics ...@@ -135,6 +138,7 @@ namespace DotNetCore.CAP.Diagnostics
{ {
if (@this.IsEnabled(CapBeforeConsume)) if (@this.IsEnabled(CapBeforeConsume))
{ {
eventData.Headers = new TracingHeaders();
@this.Write(CapBeforeConsume, eventData); @this.Write(CapBeforeConsume, eventData);
} }
...@@ -145,6 +149,7 @@ namespace DotNetCore.CAP.Diagnostics ...@@ -145,6 +149,7 @@ namespace DotNetCore.CAP.Diagnostics
{ {
if (@this.IsEnabled(CapAfterConsume)) if (@this.IsEnabled(CapAfterConsume))
{ {
eventData.Headers = new TracingHeaders();
@this.Write(CapAfterConsume, eventData); @this.Write(CapAfterConsume, eventData);
} }
} }
...@@ -153,6 +158,7 @@ namespace DotNetCore.CAP.Diagnostics ...@@ -153,6 +158,7 @@ namespace DotNetCore.CAP.Diagnostics
{ {
if (@this.IsEnabled(CapErrorConsume)) if (@this.IsEnabled(CapErrorConsume))
{ {
eventData.Headers = new TracingHeaders();
@this.Write(CapErrorConsume, eventData); @this.Write(CapErrorConsume, eventData);
} }
} }
......
...@@ -11,7 +11,6 @@ namespace DotNetCore.CAP.Diagnostics ...@@ -11,7 +11,6 @@ namespace DotNetCore.CAP.Diagnostics
string brokerTopicName, string brokerTopicBody) string brokerTopicName, string brokerTopicBody)
: base(operationId, operation) : base(operationId, operation)
{ {
Headers = new TracingHeaders();
BrokerAddress = brokerAddress; BrokerAddress = brokerAddress;
BrokerTopicName = brokerTopicName; BrokerTopicName = brokerTopicName;
BrokerTopicBody = brokerTopicBody; BrokerTopicBody = brokerTopicBody;
......
...@@ -147,7 +147,7 @@ namespace DotNetCore.CAP ...@@ -147,7 +147,7 @@ namespace DotNetCore.CAP
s_diagnosticListener.WritePublishBefore(eventData); 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) private void TracingAfter(Guid operationId, string topic, string values, DateTimeOffset startTime, TimeSpan du)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment