Closed imyzt closed 6 months ago
Would you be interested in submitting a PR for this?
@ryanjbaxter Of course, Please read my code to ensure it can run in any scenario. https://github.com/spring-cloud/spring-cloud-circuitbreaker/pull/181 Thanks.
@ryanjbaxter
I think this patch should be applied in 3.1.x
as well.
Ah! Sorry.
3.1.1
version has not been released, so I though it was not.
I'm looking forward 3.1.1 release!
Just curious: May I know when the new version(3.1.x) will be released? I am waiting for this feature. 🙏
This week.
Is your feature request related to a problem? Please describe.
When incorporating openfeign and circuitbreaker in a spring-boot project, our code submits tasks to the executorService for execution. The executorService is created using Executors.newCachedThreadPool(). We intend to customize this thread pool to propagate ThreadLocal information from the main thread to the child threads.
While the Resilience4JCircuitBreakerFactory#configureExecutorService method allows reconfiguration of the thread pool, the groupExecutorService is hard-coded in the code and lacks extensibility, making it challenging to fully implement the desired functionality.
Describe the solution you'd like
We propose making the groupExecutorService customizable or providing a mechanism for extension so that developers can seamlessly implement customizations to pass ThreadLocal information to the child threads.
Additional Information:
Code Reference: Resilience4JCircuitBreakerFactory#configureExecutorService Current Limitation: Inability to customize groupExecutorService for complete functionality implementation. Expected Outcome: We request enhancements to the Resilience4J CircuitBreakerFactory to allow developers to easily customize the groupExecutorService or provide an extension mechanism to fulfill the requirement of passing ThreadLocal information to child threads.
Sample code: