Skip to content

Commit

Permalink
Merge branch '2.1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanjbaxter committed Feb 20, 2023
2 parents 627a8f0 + 3417cc7 commit 850ea45
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,25 @@ public Customizer<ReactiveResilience4JCircuitBreakerFactory> defaultCustomizer()
----
====

===== Customizing The ExecutorService
If you would like to configure the `ExecutorService` which executes the circuit breaker you can do so using the `Resilience4JCircuitBreakerFactor`.

For example if you would like to use a context aware `ExecutorService` you could do the following.

====
[source,java]
----
@Bean
public Customizer<ReactiveResilience4JCircuitBreakerFactory> defaultCustomizer() {
return factory -> {
ContextAwareScheduledThreadPoolExecutor executor = ContextAwareScheduledThreadPoolExecutor.newScheduledThreadPool().corePoolSize(5)
.build();
factory.configureExecutorService(executor);
};
}
----
====

==== Specific Circuit Breaker Configuration

Similarly to providing a default configuration, you can create a `Customizer` bean this is passed a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,25 @@ public Customizer<ReactiveResilience4JCircuitBreakerFactory> defaultCustomizer()
----
====

===== Customizing The ExecutorService
If you would like to configure the `ExecutorService` which executes the circuit breaker you can do so using the `Resilience4JCircuitBreakerFactor`.

For example if you would like to use a context aware `ExecutorService` you could do the following.

====
[source,java]
----
@Bean
public Customizer<ReactiveResilience4JCircuitBreakerFactory> defaultCustomizer() {
return factory -> {
ContextAwareScheduledThreadPoolExecutor executor = ContextAwareScheduledThreadPoolExecutor.newScheduledThreadPool().corePoolSize(5)
.build();
factory.configureExecutorService(executor);
};
}
----
====

==== Specific Circuit Breaker Configuration

Similarly to providing a default configuration, you can create a `Customizer` bean this is passed a
Expand Down

0 comments on commit 850ea45

Please sign in to comment.