I have to construct NHibernate Session from multiple SessionFactory based on a property inside Message, I think I could use IMessageModule to handle the begin o开发者_运维问答f message processing but it doesn't have any argument and I don't know if it's possible to access current message being handled.
You can access the headers using the static Bus.CurrentMessageContext.Headers property
More here:
https://github.com/NServiceBus/NServiceBus/blob/v2.5/Samples/FullDuplex/MyClient/ClientEndpoint.cs
精彩评论