NServiceBus - How to pass custom headers in the Message envelop?
I want to be able to attach the windows authentication token without having to include that piece of dat开发者_如何学JAVAa on the messages themselves.
I've noticed that TransportMessage has Headers, but how do I get access to that before Send message to server?
See the Header Manipulation Sample there you'll see how to use headers.
To set a constant outgoing header for a client (suitable for the auth token you want), see Writing outgoing headers for all outgoing-messages
On the server, you can then Read the header.
精彩评论