This is similar to How to do akka-http request-level backpressure? but for the Spring echo system.
I'm thinking about how to implement back-pressure for HTTP clients when using Spring WebClient in a reactive fashion. To me it sounds like the way to go would be for the WebClient to be aware of the HTTP semantics and apply back pressure on e.g. status "429 - Too Many Requests". I've not found any documentation on this which makes me somewhat doubtful if this is the way to go.
Questions:
- Does back pressure based on the HTTP response headers make sense (e.g. based on the 429 or 503 status code and
Retry-After
header)? Or is there a better way of doing back-pressure over HTTP for non-streaming (request-response) use cases? - Is something like this implemented in Webclient or some other library that works well with the Spring reactive echo-system?
- If nothing like this currently exists and given that it makes sense, would it make sense to simply retry with the timeout set in the
Retry-After
header?