Closed breun closed 3 years ago
If you are not using Spring Cloud Circuitbreaker, then why not just manage the dependency yourself?
Because it's one less version number to keep up to date, and managed dependencies are a big part of the benefits of the Spring Boot ecosystem. And since Spring Cloud Circuit Breaker is already managing this, why not provide it to non-circuit breaker users as well?
It is not something Spring Cloud normally does. I will discuss it with the team.
Maybe Spring Cloud Circuit Breaker should be expanded and rebranded to Spring Cloud Resilience and add support for more of the resilience patterns that Resilience4J supports, as suggested in https://github.com/spring-cloud/spring-cloud-circuitbreaker/issues/59.
so I just did a quick experiment. The spring-cloud-dependencies bom imports the circuitbreaker dependencies bom https://github.com/spring-cloud/spring-cloud-release/blob/master/spring-cloud-dependencies/pom.xml#L72
I created a simple project that imported spring-cloud-dependencies
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
and was able to add
<dependency>
<groupId>io.github.resilience4j</groupId>
<artifactId>resilience4j-bulkhead</artifactId>
</dependency>
without a version and without error and use SemaphoreBulkhead
in a project.
SemaphoreBulkhead semaphoreBulkhead = new SemaphoreBulkhead("mybulkhead");
So I think it already works
Thanks @spencergibb! I will close this or now since it seems doable.
Ah great, I missed that, thanks!
Currently
spring-cloud-circuitbreaker-dependencies
importsresilience4j-bom
and manages its version. However, Resilience4J provides support for more than just circuit breakers and people might also want to be able to add a module likeresilience4j-bulkhead
orresilience4j-ratelimiter
as managed inresilience4j-bom
, but without using Spring Cloud Circuit Breaker. Wouldn't it therefor make sense to move theresilience4j-bom
import and management of its version up tospring-cloud-dependencies
?