diff --git a/src/DotNetCore.CAP.AzureServiceBus/ITransport.AzureServiceBus.cs b/src/DotNetCore.CAP.AzureServiceBus/ITransport.AzureServiceBus.cs index 763e381..fbac724 100644 --- a/src/DotNetCore.CAP.AzureServiceBus/ITransport.AzureServiceBus.cs +++ b/src/DotNetCore.CAP.AzureServiceBus/ITransport.AzureServiceBus.cs @@ -42,7 +42,8 @@ namespace DotNetCore.CAP.AzureServiceBus { MessageId = transportMessage.GetId(), Body = transportMessage.Body, - Label = transportMessage.GetName() + Label = transportMessage.GetName(), + CorrelationId = transportMessage.GetCorrelationId() }; foreach (var header in transportMessage.Headers) @@ -86,4 +87,4 @@ namespace DotNetCore.CAP.AzureServiceBus } } } -} \ No newline at end of file +} diff --git a/src/DotNetCore.CAP/Messages/TransportMessage.cs b/src/DotNetCore.CAP/Messages/TransportMessage.cs index c4f7fa7..80c1fe7 100644 --- a/src/DotNetCore.CAP/Messages/TransportMessage.cs +++ b/src/DotNetCore.CAP/Messages/TransportMessage.cs @@ -43,5 +43,10 @@ namespace DotNetCore.CAP.Messages { return Headers.TryGetValue(Messages.Headers.Group, out var value) ? value : null; } + + public string GetCorrelationId() + { + return Headers.TryGetValue(Messages.Headers.CorrelationId, out var value) ? value : null; + } } }