While running a test on v5 I noticed that for every send message log.debug record that message headers are empty. When I run acceptance tests and debuged the code it seems that OutgoingLogicalMessage.Headers is empty but OutgoingMessage.Headers contains a list of headers.
I am not sure why this is the case, but either in the LogOutgoingMessageBehavior we should use OutgoingMessage rather than OutgoingLogicalMessage.
Code that logs it is here
https://github.com/Particular/NServiceBus/blob/5.2.14/src/NServiceBus.Core/Unicast/Behaviors/LogOutgoingMessageBehavior.cs#L27
@WojcikMike does the same issue exist in v6? (+1 on not fixing this in v5)
@timbussmann in v6 it works well, it uses Operation:
https://github.com/Particular/NServiceBus/blob/151f61bf30f8748fa1df8a29f1f6de1d7e7bde54/src/NServiceBus.Core/Pipeline/Outgoing/RoutingToDispatchConnector.cs#L41
So this bug is only related to v5. However the question still stands, how to fix it? Or to be more precised should OutgoingLogicalMessage.Headers have different values than OutgoingMessage.Headers and which we should log.
@WojcikMike
However the question still stands, how to fix it?
I think we need to first do the triage before we talk about how to fix it.
So this bug is only related to v5.
As long as it's only logging which is wrong, it don't see this causing any damage we need to fix urgently. If however this difference in headers between the properties causes any other issues, this would be a different story. Feel free to investigate whether there are other bugs related to this @WojcikMike but I think we should close this one.
closing this as this is no issue in v6 and it's probably not worth to backport. Feel free to reopen/challenge that decision. /cc @WojcikMike