Why use Circuit Breaker and Bulkhead when working with Spring Reactor?

寵の児 提交于 2021-02-17 05:34:31

问题


Please help me find reasons why Circuit breaker and Bulkhead patterns are useful in a Spring Reactor application.

Since operations will be non-blocking in Reactor and those two patterns aim at saving potential hit to resources (mostly threads), in what cases can I benefit the patterns in my Spring Reactor app. The only thing I see at this point is if the requests are such a tremendously huge amount that keeping them in memory, while waiting for a timeout (instead of Circuit Breaker being up and falling back) we run OOM.


回答1:


Beside protecting your own application, these patterns also help you protect external services (REST API, database, etc): in case of increased latency and/or error rate, you give them room to recover. Failing fast in your application is also beneficial as you don't make your end-users wait too long for an error.

Resilience4j provides dedicated Reactor support for these patterns in place of the deprecated Hystrix library.



来源:https://stackoverflow.com/questions/62872623/why-use-circuit-breaker-and-bulkhead-when-working-with-spring-reactor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!