NServiceBus message handlers do not fire in the expected order. Saga handler fires earlier

We use our own host and first want to specify a single handler. We have a message validation handler that we would like to run before our Saga handler. We tried to establish order using the code below, but looking at our logs, our saga message handler starts first, and then the check handler. Were you at an impasse and surprised that the saga has anything to do with it? If you have any ideas, let us know.

Documentation from here: http://docs.particular.net/nservicebus/handlers/handler-ordering

NServiceBus.Configure.With() ... .UnicastBus() .LoadMessageHandlers<First<YourHandler>>() 

Our code is as follows:

 var bus = Configure.With() ... .UnicastBus() .LoadMessageHandlers(new First<ValidationHandler>()) 
+4
source share
1 answer

Change your code to an example in NServiceBus faq. I had the same problem, I did too

 .UnicastBus() .LoadMessageHandlers(new First<ValidationHandler>()) 

When I switched to

 .UnicastBus() .LoadMessageHandlers<First<YourHandler>>() 

he ran handlers in the expected order

+1
source

Source: https://habr.com/ru/post/1346746/


All Articles