Skip to content

Retry and Rate Limit chaining #1718

Answered by peter-csala
LBalsa asked this question in Q&A
Discussion options

You must be logged in to vote

Hi LBalsa, the pollydocs have been recently extended with several sequence diagrams regarding ResiliencePipelines to clarify how strategy chaining works.

builder.AddRetry(...).AddRateLimiter(...).

In this case the retry will be your outer strategy and the rate limiter will be the inner. Depending on your rate limiter setup it either allows the request, queues it or rejects it. The retry will be triggered only if the rate limiter reject the request or the rate limiter does not handle the thrown exception.

should I create two pipelines and call the rate limiter from within the retry one?

Nesting ExecuteAsync calls are considered anti-pattern. Here you can read more about this topic.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LBalsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants