Redeliveries in sagas
See original GitHub issueIs this a bug report?
No.
Suggestion
Occasionally when using the state machines I would like to have the option to redeliver a message in case of a missing instance. Something along the lines of
Event(() => GoatEnteredTheBarn, cfg => {
cfg.CorrelateById(x => x.Message.BarnId);
cfg.OnMissingInstance(x => x.Redeliver(TimeSpan.FromMinutes(5), throwAfterFailedRedeliveries: 3);
});
This would then redeliver this message to the state machine using the redelivery support in MT, and after the 3rd failed redelivery it would act the same as x.Fault().
Bonus suggestion
Redelivery in general would be a nice thing to have in the process managers. Being able to say that certain messages in certain states should be redelivered later could lower the complexity of some cases where the state machine needs to wait for an operation that makes it enter a later state before handling later requests. Retries can ofc help some, but they seem more geared towards smoothing out the cases where you expect things to “clear up” relatively fast, so they dont really solve the same issues.
If these suggestions seem useful Id be happy to at least try to send a PR to help out (if I manage to figure it out 😉 ).
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)

Top Related StackOverflow Question
Part of me dont want to admit this now, but I may have just made that part up 😉 Although I kinda feel like Im telling someone that santa doesnt exist now, which feels really bad. Sorry.
@phatboyg That looks great 😃 Only problem is now I realized that I have one case where the instance might not be missing but rather Id have an instance but it wouldnt be in the right state yet. Though currently I solve that case by “remembering” that I have seen it and having extra logic checking for remembered things when I enter the state where I accept it. It would probably be cleaner to just redeliver those messages later instead. But thats a totally different issue. This addresses the missing instance case quite nicely 😃