For the latest stable version, please use Spring-Cloud-CircuitBreaker 3.2.0! |
Bulkhead Properties Configuration
You can configure ThreadPoolBulkhead and SemaphoreBulkhead instances in your application’s configuration properties file.
Property configuration has higher priority than Java Customizer
configuration.
resilience4j.thread-pool-bulkhead:
instances:
backendA:
maxThreadPoolSize: 1
coreThreadPoolSize: 1
resilience4j.bulkhead:
instances:
backendB:
maxConcurrentCalls: 10
You can also provide common configuration via resilience4j.bulkhead.configs.
and
resilience4j.thread-pool-bulkhead.configs.
properties. This allows you to specify configuration
once and reuse it across multiple bulkheads.
resilience4j.bulkhead:
configs:
default:
queueCapacity: 5
someShared:
queueCapacity: 10
instances:
backendA:
baseConfig: default
maxConcurrentCalls: 10
backendB:
baseConfig: someShared
If you configure your bulkhead this way it will take lowest priority. The priority order is:
-
resilience4j.thread-pool-bulkhead.instances.
orresilience4j.bulkhead.instances.
-
Customizer
configuration usingResilience4JBulkheadProvider
. -
resilience4j.thread-pool-bulkhead.configs.
orresilience4j.bulkhead.configs.
For more information on the Resilience4j property configuration, see Resilience4J Spring Boot 2 Configuration.