NServiceBus - How do I pass custom headers in a message envelope?

I want to be able to include a Windows authentication token without including this piece of data in the messages themselves.

I noticed that TransportMessage has headers, but how do I access this before sending a message to the server?

+3
source share
1 answer

See Sample Header Header , you will see how to use headers.

To set a permanent outgoing header for the client (suitable for the desired Auth token), see Recording outgoing headers for all outgoing messages.

On the server you can read the header .

+7
source

Source: https://habr.com/ru/post/1309960/


All Articles