masstransitautomatonymous

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.


Solution

  • 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).