Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Consumer saga vs Automatonymous in MassTransit

What exactly is a consumer saga, and how is it different from Automatonymous? I know that Automatonymous is a separate library that is used by MassTransit.

like image 237
Rafał Ryszkowski Avatar asked Oct 20 '25 11:10

Rafał Ryszkowski


1 Answers

Consumer sagas, for lack of a better name, are the original sagas implemented by MassTransit when it was created 13 years ago. They were consumers with state and used variants of IConsumer<T> to direct messages to saga instances. Consumer sagas implement one or more interfaces to consume correlated saga events. This support is included so that it is easy to move applications from other saga implementations to MassTransit.

State Machine Sagas, which use Automatonymous, provide a powerful state machine syntax to create sagas. They are more flexible in terms of event correlation, and have a fluent syntax for defining state and behavior. They also work nicely with dependency injection via the creation of custom activities which are resolved at run-time for each message.

Automatonymous was written separately to enable its use out of MassTransit, but it by the same author (me).

like image 64
Chris Patterson Avatar answered Oct 22 '25 03:10

Chris Patterson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!