From 7173d7f0d33882e122fc8e144f0a8a82bf78951f Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Fri, 5 Jan 2024 11:23:25 -0500 Subject: [PATCH] Add documentation to configure group execute service. Fixes #182 --- .../specific-circuit-breaker-configuration.adoc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/modules/ROOT/pages/spring-cloud-circuitbreaker-resilience4j/specific-circuit-breaker-configuration.adoc b/docs/modules/ROOT/pages/spring-cloud-circuitbreaker-resilience4j/specific-circuit-breaker-configuration.adoc index aacb0ba0..3c643ccd 100644 --- a/docs/modules/ROOT/pages/spring-cloud-circuitbreaker-resilience4j/specific-circuit-breaker-configuration.adoc +++ b/docs/modules/ROOT/pages/spring-cloud-circuitbreaker-resilience4j/specific-circuit-breaker-configuration.adoc @@ -27,6 +27,16 @@ public Customizer slowCustomizer() { } ---- +If you need to propogate the security context to the Circuit Breaker you must configure the circuit breaker to use `DelegatingSecurityContextExecutorService`. + +[source,java] +---- +@Bean +public Customizer groupExecutorServiceCustomizer() { + return factory -> factory.configureGroupExecutorService(group -> new DelegatingSecurityContextExecutorService(Executors.newVirtualThreadPerTaskExecutor())); +} +---- + [[reactive-example]] == Reactive Example