I would like to capture information about the current user when publishing messages into rebus so that the handlers and sagas have transparent and correct access to the application user information. I'm getting a little lost in the source code but basically I'm trying to set up several things:
A hook which runs when a message is published and puts the current user information into the header
A hook which runs in the worker when the message is received and rewrites the ClaimsPrincipal.Current.
A hook which runs in the worker when processing is done and resets ClaimsPrincipal.Current.
Any suggestions would be appreciated.