Search code examples
masstransitsagaautomatonymous

Masstransit State Machine - Retry Mechanism


In case a message is being "retried" as a result of an exception, is it being returned physically to the queue? to the beginning? to the end? Is it re-processed after the existed messages in queue? Is it being kept in application memory?

I have not found any description for the masstransit retry mechanism flow in the documentation.

Please refer me to any documentation that explains it, thanks.


Solution

  • MassTransit will retry the message within the same consumer delivery - the retry is only on the consumer/saga/handler delivery pipeline. In the case of a saga, the database transaction (if present) is aborted, and a new transaction is started - including re-reading the saga instance from the database.

    The message is not returned to the queue for other workers to process.

    If the retry policy limit is reached, the message is moved to the _error queue.