circuit-breaker

Spring cloud stream kafka pause/resume binders

感情迁移 提交于 2019-12-02 03:07:58
问题 We are using spring cloude stream 2.0 & Kafka as a message broker. We've implemented a circuit breaker which stops the Application context, for cases where the target system (DB or 3rd party API) is unavilable, as suggested here: Stop Spring Cloud Stream @StreamListener from listening when target system is down Now in spring cloud stream 2.0 there is a way to manage the lifecycle of binder using actuator: Binding visualization and control Is it possible to control the binder lifecycle from

Spring cloud stream kafka pause/resume binders

ⅰ亾dé卋堺 提交于 2019-12-02 00:36:41
We are using spring cloude stream 2.0 & Kafka as a message broker. We've implemented a circuit breaker which stops the Application context, for cases where the target system (DB or 3rd party API) is unavilable, as suggested here: Stop Spring Cloud Stream @StreamListener from listening when target system is down Now in spring cloud stream 2.0 there is a way to manage the lifecycle of binder using actuator: Binding visualization and control Is it possible to control the binder lifecycle from the code, means in case target server is down, to pause the binder, and when it's up, to resume ? Sorry,

Polly Circuit breaker pattern - For testing connection strings

孤人 提交于 2019-11-29 17:02:58
I'm trying to test whether the connection string is null using Polly. If it is null, I want to try three times using the CircuitBreaker and the message should be outputted in the Console window. Policy policy = null; // Break the circuit after the specified number of exceptions // and keep circuit broken for the specified duration. policy = Policy .Handle<NullReferenceException>() .CircuitBreaker(3, TimeSpan.FromSeconds(30)); try { string connected = policy.Execute(() => repository.GetConnectionString()); } catch (Exception ex) { Console.WriteLine("{0}",ex.Message); } and the

Polly Circuit breaker pattern - For testing connection strings

梦想与她 提交于 2019-11-28 11:23:45
问题 I'm trying to test whether the connection string is null using Polly. If it is null, I want to try three times using the CircuitBreaker and the message should be outputted in the Console window. Policy policy = null; // Break the circuit after the specified number of exceptions // and keep circuit broken for the specified duration. policy = Policy .Handle<NullReferenceException>() .CircuitBreaker(3, TimeSpan.FromSeconds(30)); try { string connected = policy.Execute(() => repository

Hystrix Configuration

不羁的心 提交于 2019-11-27 11:20:12
问题 I am trying to implement hystrix for my application using hystrix-javanica. I have configured hystrix-configuration.properties as below hystrix.command.default.execution.isolation.strategy=SEMAPHORE hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=10000 hystrix.command.default.fallback.enabled=true hystrix.command.default.circuitBreaker.enabled=true hystrix.command.default.circuitBreaker.requestVolumeThreshold=3 hystrix.command.default.circuitBreaker