Automatonymous Saga with multiple correlated instances

386 views
Skip to first unread message

robinb...@gmail.com

unread,
Jul 7, 2015, 5:23:54 PM7/7/15
to masstrans...@googlegroups.com
Hi all,

I'm using MT2 with Automatonymous. I have a state machine that correlates messages using the StateMachineSagaRepositoryConfigurator callback.

(configurator) =>
{
   
configurator.Correlate(this.SomeEvent, (saga, message) => (saga.Id1 == message.Id1 && saga.Id2 == message.Id2);
}

My question is what is the expected behavior if the correlation step matches multiple saga instances? Doing some quick tests, it seems like if an event correlates to multiple instances, the event is raised on each instance. This is actually the desired behavior I was looking for, but I wanted to check to see If perhaps I was misunderstanding how it should work. Thank You.

- RBJ

Chris Patterson

unread,
Jul 7, 2015, 6:46:12 PM7/7/15
to masstrans...@googlegroups.com
That is exactly how it should work, glad it actually does :)


--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/0ff90160-bfd5-404e-befc-b45cf02c8392%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

robinb...@gmail.com

unread,
Jul 7, 2015, 7:53:49 PM7/7/15
to masstrans...@googlegroups.com
Excellent. Thanks for the quick reply Chris.

As a followup, I haven't had a chance to test yet, but what happens if no instances match the correlation? Does the message end up in the error queue, or does the saga just not raise any events?


On Tuesday, July 7, 2015 at 4:46:12 PM UTC-6, Chris Patterson wrote:
That is exactly how it should work, glad it actually does :)

On Tue, Jul 7, 2015 at 2:23 PM, <robinb...@gmail.com> wrote:
Hi all,

I'm using MT2 with Automatonymous. I have a state machine that correlates messages using the StateMachineSagaRepositoryConfigurator callback.

(configurator) =>
{
   
configurator.Correlate(this.SomeEvent, (saga, message) => (saga.Id1 == message.Id1 && saga.Id2 == message.Id2);
}

My question is what is the expected behavior if the correlation step matches multiple saga instances? Doing some quick tests, it seems like if an event correlates to multiple instances, the event is raised on each instance. This is actually the desired behavior I was looking for, but I wanted to check to see If perhaps I was misunderstanding how it should work. Thank You.

- RBJ

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.

Chris Patterson

unread,
Jul 8, 2015, 12:16:20 PM7/8/15
to masstrans...@googlegroups.com
I'm pretty sure that it vanishes, or ends up on the error queue. One of those.

I think error queue. Because we've had to clean out error queues in production when engineers forget about the not created instance state event case. 

____
Chris Patterson




To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.

To post to this group, send email to masstrans...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages