https://kotlinlang.org logo
Title
m

Matthieu Stombellini

12/16/2021, 12:39 AM
Hi, does the Ktor client have a built-in way of automatically delaying/pausing then retrying when it receives a 429 response? Is there a plugin that could do that for me?
j

John O'Reilly

12/16/2021, 8:02 AM
Ktor 2.0 has I believe a new
HttpRequestRetry
feature....not sure though how much it's behaviour can be customized
a

Aleksei Tirman [JB]

12/16/2021, 8:08 AM
You can find more information about this plugin in the documentation.
👍 1
m

Matthieu Stombellini

12/17/2021, 7:46 PM
Thanks. I'm specifically looking for something I could use in production (so excluding 2.0 stuff for now), and I don't think HttpRequestRetry is able to use the response from 429 to adapt its wait time, can it?
a

Aleksei Tirman [JB]

12/18/2021, 7:45 AM
@Rustam Siniukov
r

Rustam Siniukov

12/18/2021, 9:55 PM
HttpRequestRetry
will support
Retry-After
header by default