I'm facing a weird situation were my sagas sometimes just stop invoking next steps while no errors are written to the logs. so for example consider this (pseudo)code:
public async Task Handle(Step1 step1)
{
//... do something
await _bus.Send(new Step2 { Id = step1.Id });
}
public async Task Handle(Step2 step2)
{
//... do something else
// go to next step
}
In this case step1
is handled fine but there are just no signs of Handle(Step2 step2)
ever being invoked with the saga data just sitting in the SQL table with revision
field being equal to 1
and no messages in main or error queues of the RabbitMq. Is at-least-once delivery guarantee applicable here? Any suggestions of how this is possible or which debug information I could add?
I'm using MySQL persistence and RabbitMq transport with this config:
services.AddRebus(configure => configure
.Logging(l => l.MicrosoftExtensionsLogging(loggerFactory))
.Transport(t => t.UseRabbitMq(rabbitMqConnection, "rebusqueue"))
.Sagas(s =>
{
s.StoreInMySql(dbConnection, "Rebus_Saga_Data", "Rebus_Saga_Data_Index");
s.EnforceExclusiveAccess();
})
.Timeouts(t => t.StoreInMySql(dbConnection, "Rebus_Saga_Timeouts"))
.Routing(r => r.TypeBased().MapAssemblyOf<MessageBase>("rebusqueue")));