开发者

What happens in a NServiceBus Saga when the IAmStartedBy Message comes after the IHandle Message?

开发者 https://www.devze.com 2023-01-01 20:38 出处:网络
I have an NServiceBus Saga that looks like this public class MySaga : Saga<MySagaData>, IAmStartedByMessages<MyStartMessage>,

I have an NServiceBus Saga that looks like this

public class MySaga : Saga<MySagaData>,
                                IAmStartedByMessages<MyStartMessage>,
   开发者_JAVA百科                             IHandleMessages<OtherMessage>

But messages can come out of order. So what happens when the IAmStartedBy Message comes after the IHandle Message? There will be no SagaData for OtherMessage. Will NServiceBus swallow the message or try to re-handle it later?


NServiceBus will fail to find an active saga for OtherMessage, retry the configured number of times and then put the message in the error queue. The retries might delay long enough for MyStartMessage to arrive. Any reason why OtherMessage can't start the saga as well? (you can have multiple messages that can start a saga)

0

精彩评论

暂无评论...
验证码 换一张
取 消