Spring Cloud Hoxton.SR10 Spring Cloud OpenFeign 2.2.7 Spring Cloud Netflix Hystrix 2.2.7
feign.circuitbreaker.enabled=true
I'm migrating from Feign Hystrix to Spring Cloud CircuitBreaker with Spring Cloud Netflix Hystrix implementation. And I see that there no possibility to configure Hystrix ThreadPools per client.
Previus:
hystrix.threadpool.backendA.coreSize=30
hystrix.threadpool.backendB.coreSize=20
backendA and backendB were group keys for Hystrix's command.
But now there one common group key in HystrixCircuitBreakerFactory :
HystrixCommandGroupKey.Factory.asKey(getClass().getSimpleName() //=HystrixCircuitBreakerFactory
Comment From: Ferioney
+ @ryanjbaxter
I think the simplest solution is to create a new method with groupName in CircuitBreakerFactory:
public abstract CircuitBreaker create(String id, String groupName);
It also allows other circuit breaker implementations to use this value to create bulkheads.
And then use it in FeignCircuitBreakerInvocationHandler
String circuitName = Feign.configKey(target.type(), method);
CircuitBreaker circuitBreaker = this.factory.create(circuitName, this.feignClientName);
Comment From: ryanjbaxter
Im not sure I see the point in doing this since Hystrix is removed in 2020.0.x. I would rather not add an API if we don't have to.
Can you provide a good example of why it would be needed when using bulkheads?
Comment From: Ferioney
@ryanjbaxter That you for the quick answer.
I see the next points to use bulkhead per client 1. Management of clients is simpler than for each method. For example, I have a client with 50 methods (endpoints of one service). I that case I should create a configuration for each method - that so a lot of configuration. It is simpler to have a configuration per client. 2. Complicated migration from Hystrix. For example, I have a client with 10 methods (endpoint of one service) and provide 100 threads for this client. Now I should separate this theadpool for 10 theadpools. But I can't just divide by 10. Some method needs more thread (I call this method often), some less (for example I call this method ones per day). 3. Reason of failure. For example, I have a client which calls ServiceA. If ServiceA is down, it enough to have one bulkhead for this service.
Comment From: ryanjbaxter
OK. I am open to it more for 1, and 3. If you want to work on a PR over in Spring Cloud CircuitBreaker we can try and add the functionality.