Sfoglia il codice sorgente

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 anni fa
committed by GitHub
parent
commit
01053b1a84
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: 4AEE18F83AFDEB23
2 ha cambiato i file con 8 aggiunte e 2 eliminazioni
  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 Vedi File

@@ -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 Vedi File

@@ -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;
}
}
}

Caricamento…
Annulla
Salva