每条消息的 NServiceBus IMessageModule
我必须根据 Message 中的属性从多个 SessionFactory 构造 NHibernate Session,我想我可以使用 IMessageModule 来处理消息处理的开始,但它没有任何参数,我不知道是否可以访问当前消息正在处理。
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 of message processing but it doesn't have any argument and I don't know if it's possible to access current message being handled.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用静态 Bus.CurrentMessageContext.Headers 属性访问标头
更多信息:
https://github.com/NServiceBus/NServiceBus/blob/v2.5/Samples/FullDuplex/MyClient/ClientEndpoint.cs
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