I have a similar problem to this question and I do not see an accepted answer. I have researched through and did not get a satisfactory answer.
I have a reactive Kafka consumer (Spring Reactor) with a poll amount 'x' and the application pushes the messages polled to a reactive endpoint using reactive webclient. The issue here is that the external service can perform differently overtime and I will have to adjust the Kafka consumer to poll less messages when the circuit breaker opens (Or kick in backpressure) when we see lot of failures. Is there a way in the current reactor to automatically
- React when the circuit breaker is in open state and reduce the poll amount or slow down the consumption.
- Increase the poll amount to the previous state when the circuit is closed ( External service would scaled up if it goes down ).
I do not want to use delayElements
or delayUntil
since these are mostly static in nature and want the application to react during runtime. How can I configure these end to end backpressure? I would provide the values for consumers when the circuit is closed, partially closed and open in app configs.