NServiceBus 消息处理程序未按预期顺序触发 Saga 处理程序提前触发
我们正在使用自己的主机,并希望指定首先触发的单个处理程序。我们有一个消息验证处理程序,我们希望在 Saga 处理程序之前触发它。我们尝试使用下面的代码设置顺序,但在日志中查看我们的传奇消息处理程序首先触发,然后验证处理程序触发。我们感到困惑并想知道这个传奇故事是否与此有关? 如果您有任何想法请告诉我们。
来自此处的文档: http://docs.pspecial.net/nservicebus/handlers/handler-ordering
NServiceBus.Configure.With()
...
.UnicastBus()
.LoadMessageHandlers<First<YourHandler>>()
我们的代码如下所示:
var bus = Configure.With()
...
.UnicastBus()
.LoadMessageHandlers(new First<ValidationHandler>())
We are using our own host and want to specify a single handler to fire first. We have a message validation handler that we would like to fire before our Saga handler. We have tried to set the order using the code below but looking in our logs our saga message handler fires first then the validation handler fires. Were stumped and wondered if the saga has anything to do with it?
If you have any ideas please let us know.
Documentation from here: http://docs.particular.net/nservicebus/handlers/handler-ordering
NServiceBus.Configure.With()
...
.UnicastBus()
.LoadMessageHandlers<First<YourHandler>>()
Our code looks like this:
var bus = Configure.With()
...
.UnicastBus()
.LoadMessageHandlers(new First<ValidationHandler>())
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将您的代码更改为 NServiceBus 常见问题解答中的示例。我遇到了同样的问题,我也在做
当我切换到
它时按预期顺序运行处理程序
Change your code to the example in the NServiceBus faq. I had the same problem, i was also doing
When I switched to
it ran the handlers in the expected order