question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Redeliveries in sagas

See original GitHub issue

Is 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:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
wastazcommented, May 30, 2019

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.

0reactions
wastazcommented, Jun 7, 2019

@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 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to implement redelivery with infinite retry until saga is ...
What i am looking for is that for as long as the saga is alive (12 hours) we want to redeliver, but when...
Read more >
How to properly handle unexpected asynchronous events ...
One of the options is try to redeliver that events later and wait while "ProcessingStarted" consumed and saga initiated. Is it good or...
Read more >
API Reference
Creates a Redux middleware and connects the Sagas to the Redux Store. options: Object - A list of options to pass to the...
Read more >
Introduction to Redux Saga | LoginRadius Blog
Redux Saga is a middleware library used to allow a Redux store to interact with resources outside of itself asynchronously. This includes making...
Read more >
Error Handling and Message Redelivery in MassTransit
In this article, I will try to explain some of the problems like Error handling and message Redelivery that I have encountered in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found