I am using MassTransit in my application and would like to configure multiple retry policies. The documentation doesn't mention how they would interact so I hope someone can clarify.
What I want to do is implement secondary retry for some consumers waiting for an available resource. In the event that the resource is unavailable, I want to throw a specific exception and retry later.
For this, I have something like this.
ep.UseRetry(retryConfig =>
{
retryConfig.Handle<RetryLaterException>();
retryConfig.Interval(5, TimeSpan.FromMinutes(1));
});
I also want a generic retry policy that would handle all failures except when I need a retry.
ep.UseRetry(retryConfig =>
{
retryConfig.Ignore<RetryLaterException>();
retryConfig.Interval(5, TimeSpan.FromSeconds(1));
});
Can MassTransit handle this? At which level should I place these retry policies for optimal results (Bus, Endpoint or Consumer)?
Thank you