浏览代码

Set correlation Id for azure service bus message (#673)

* Update TransportMessage.cs

Added GetCorrelationId to TransportMessage

* Update ITransport.AzureServiceBus.cs

Set CorrelationId for Microsoft.Azure.ServiceBus.Message
master
Henery309 4 年前
committed by GitHub
父节点
当前提交
01053b1a84
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 2 个文件被更改,包括 8 次插入2 次删除
  1. +3
    -2
      src/DotNetCore.CAP.AzureServiceBus/ITransport.AzureServiceBus.cs
  2. +5
    -0
      src/DotNetCore.CAP/Messages/TransportMessage.cs

+ 3
- 2
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
}
}
}
}
}

+ 5
- 0
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;
}
}
}

正在加载...
取消
保存