circuit-breaker

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

Spring Retry Circuit breaker opening for all exceptions

一个人想着一个人 提交于 2021-01-29 08:41:32
问题 I was trying to use Spring Retry Circuit Breaker. My requirement is to open the Circuit only for repetitive exceptions of a specific type. And for all other exceptions, I would like to pass the exception back to the caller without opening the circuit. What I am observing is that the Circuit is opening for all types of Exceptions, not just the specific exception. Wondering if this is how it is designed to work? My requirement: When I call a remote service, I would like to open the service only

Automatic rate adjustment in Reactor

你说的曾经没有我的故事 提交于 2021-01-28 03:24:20
问题 TL;DR; Is there a way to automatically adjust delay between elements in Project Reactor based on downstream health? More details I have an application that reads records from Kafka topic, sends an HTTP request for each one of them and writes the result to another Kafka topic. Reading and writing from/to Kafka is fast and easy, but the third party HTTP service is easily overwhelmed, so I use delayElements() with a value from a property file, which means that this value does not change during

Polly CircuitBreakerAsync is not working as I expect

早过忘川 提交于 2021-01-27 21:17:17
问题 I'm just trying out the Polly CircuitBreakerAsync and it's not working as I expect. What am I doing wrong here? I expect the code below to complete and say the circuit is still closed. using Polly; using System; using System.Threading.Tasks; public class Program { public static void Main(string[] args) { MainAsync(args).GetAwaiter().GetResult(); } static async Task MainAsync(string[] args) { var circuitBreaker = Policy .Handle<Exception>() .CircuitBreakerAsync( 3, //

Polly Circuit Breaker handled and unhandled exceptions

為{幸葍}努か 提交于 2021-01-07 02:48:32
问题 I want to use Polly to implement a Circuit Breaker pattern. In the docs, there is a description of the Half Open state, and there it says: If a handled exception is received, that exception is rethrown, and the circuit transitions immediately back to open, and remains open again for the configured timespan. If an unhandled exception is received, the circuit remains in half-open. I'm not sure I understand the difference here between handled and unhandled exception. We are describing a case

Polly Circuit Breaker handled and unhandled exceptions

你。 提交于 2021-01-07 02:47:35
问题 I want to use Polly to implement a Circuit Breaker pattern. In the docs, there is a description of the Half Open state, and there it says: If a handled exception is received, that exception is rethrown, and the circuit transitions immediately back to open, and remains open again for the configured timespan. If an unhandled exception is received, the circuit remains in half-open. I'm not sure I understand the difference here between handled and unhandled exception. We are describing a case

Elasticsearch unassigned shards CircuitBreakingException[[parent] Data too large

霸气de小男生 提交于 2021-01-01 13:58:38
问题 I got alert stating elasticsearch has 2 unassigned shards. I made below api calls to gather more details. curl -s http://localhost:9200/_cluster/allocation/explain | python -m json.tool Output below "allocate_explanation": "cannot allocate because allocation is not permitted to any of the nodes", "can_allocate": "no", "current_state": "unassigned", "index": "docs_0_1603929645264", "node_allocation_decisions": [ { "deciders": [ { "decider": "max_retry", "decision": "NO", "explanation": "shard

Elasticsearch unassigned shards CircuitBreakingException[[parent] Data too large

馋奶兔 提交于 2021-01-01 13:54:46
问题 I got alert stating elasticsearch has 2 unassigned shards. I made below api calls to gather more details. curl -s http://localhost:9200/_cluster/allocation/explain | python -m json.tool Output below "allocate_explanation": "cannot allocate because allocation is not permitted to any of the nodes", "can_allocate": "no", "current_state": "unassigned", "index": "docs_0_1603929645264", "node_allocation_decisions": [ { "deciders": [ { "decider": "max_retry", "decision": "NO", "explanation": "shard

Polly Circuit breaker not maintaining state with .net core HTTP Client

余生长醉 提交于 2020-03-26 03:52:11
问题 I have implemented the polly retry and Circuit breaker policy (wrapped). when the call fails and the circuit is open for the previous call the next call again goes to the retry and hit the circuit breaker again instead of just throwing the circuitbreakexception. I think somehow the HTTP client is getting recreated again even though am using the typed client. I am not able to figure the issue. Here is the code Startup public void ConfigureServices(IServiceCollection services) { services.AddMvc