Skip to content

Commit

Permalink
add incoming headers to envelope for ASB transport
Browse files Browse the repository at this point in the history
  • Loading branch information
kirill-gerasimenko-da committed Feb 17, 2024
1 parent 46c39ef commit fce5b1b
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ protected override void writeOutgoingHeader(ServiceBusMessage outgoing, string k
outgoing.ApplicationProperties[key] = value;
}

protected override void writeIncomingHeaders(ServiceBusReceivedMessage incoming, Envelope envelope)
{
if (incoming.ApplicationProperties == null) return;

foreach (var pair in incoming.ApplicationProperties) envelope.Headers[pair.Key] = pair.Value?.ToString();
}

protected override bool tryReadIncomingHeader(ServiceBusReceivedMessage incoming, string key, out string? value)
{
if (incoming.ApplicationProperties.TryGetValue(key, out var header))
Expand Down

0 comments on commit fce5b1b

Please sign in to comment.