We have an old solution running on top of NServiceBus 5.2.6/NServiceBus.RabbitMQ 3.5.2.
It has a custom CustomMessageIdStrategy registered on the RabbitMQ transport that is used to copy the value of the UserId property (if exists) from the BasicProperties of the incoming RabbitMQ message onto a custom header entry of the message. The handler then is able to inspect the the value of the custom header and make some decision based on it.
We are aiming to upgrade to the latest NServiceBus version. Doing some tests with NServiceBus 7.1.6/NServiceBus.RabbitMQ 5.0.2 it seems the same approach does no longer work. The CustomMessageIdStrategy is being invoked as usual, however, it looks like the custom header that is added does not “survive” and reach the handler being called afterwards in the pipeline.
I also tried implementing and using IMutateIncomingMessages/IMutateIncomingTransportMessages interfaces. They get called as expected, but the RabbitMQ BasicProperties are not available on neither of those, so it is impossible to achieve what was working with NServiceBus 5.2.6 CustomMessageIdStrategy.
How can I achieve the same thing on latest NServiceBus runtime?