Skip to content

Resilience4j bulkhead patterns#87

Merged
ryanjbaxter merged 4 commits intospring-cloud:masterfrom
Ferioney:issue-86
Feb 22, 2021
Merged

Resilience4j bulkhead patterns#87
ryanjbaxter merged 4 commits intospring-cloud:masterfrom
Ferioney:issue-86

Conversation

@Ferioney
Copy link
Copy Markdown

added supporting of resilience4j bulkhead patterns
Fixes gh-86

Copy link
Copy Markdown
Contributor

@ryanjbaxter ryanjbaxter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot make such major changes in a minor release. We need to maintain the default behavior.

I think we can optionally enable the use of a Bulkhead if resilience4j-bulkhead is on the classpath.

<dependency>
<groupId>io.github.resilience4j</groupId>
<artifactId>resilience4j-all</artifactId>
<scope>provided</scope>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be optional?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use resilience4j-bulkhead?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, changed.

resilience4j-all provides a Decorator class which is very useful for creating citcuitBreater/TimeLimiter/Bulkheads pipeline.
And resilience4j-all includes resilience4j-bulkhead module

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know which module the Decorator is in? -all brings in much more than we need.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In resilience4j-all: Decorators

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ferioney how much extra code would it be to not use the decorators? I talked this over with the team and the general consensus was that we should avoid requiring extra dependencies when they are not needed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can do it without Decorators:
Commit 870dc37 Resilience4jBulkheadProvider.java

added supporting of resilience4j bulkhead patterns
Fixes gh-86
@Ferioney
Copy link
Copy Markdown
Author

@ryanjbaxter I think we can also implement support of config files in this topic (similar to the Support Resilience4J Configuration Properties ). What do you think?

@ryanjbaxter
Copy link
Copy Markdown
Contributor

@Ferioney This looks good just fix the merge conflicts.

I think we can also implement support of config files in this topic (similar to the Support Resilience4J Configuration Properties ). What do you think?

So you can configure bulkheads using configuration properties?

Andrii Bohutskyi added 2 commits February 22, 2021 18:25
implemented resilience4j bulkhead without Decorators
# Conflicts:
#	spring-cloud-circuitbreaker-resilience4j/pom.xml
#	spring-cloud-circuitbreaker-resilience4j/src/main/java/org/springframework/cloud/circuitbreaker/resilience4j/Resilience4JAutoConfiguration.java
#	spring-cloud-circuitbreaker-resilience4j/src/main/java/org/springframework/cloud/circuitbreaker/resilience4j/Resilience4JCircuitBreaker.java
#	spring-cloud-circuitbreaker-resilience4j/src/main/java/org/springframework/cloud/circuitbreaker/resilience4j/Resilience4JCircuitBreakerFactory.java
@Ferioney
Copy link
Copy Markdown
Author

Ferioney commented Feb 22, 2021

@ryanjbaxter I did some major changes in PR, please review again.
Main changes:

  1. Added support of properties file for Bulkheads.
  2. Changed default bulkhead implementation from Semaphone to ThreadPool. My team and I think it more relevant for people who are going to migrate from Hystrix to Resilience4j.
  3. Changed default behavior of property spring.cloud.bulkhead.resilience4j.enable

@Ferioney Ferioney requested a review from ryanjbaxter February 22, 2021 17:48
Comment thread README.adoc Outdated
@Ferioney Ferioney requested a review from ryanjbaxter February 22, 2021 19:07
merge master into current branch
implement support of resilience4j-spring-boot2 in bulkhead provider
@ryanjbaxter ryanjbaxter changed the title Issue-86 Resilience4j bulkhead patterns Feb 22, 2021
@ryanjbaxter ryanjbaxter merged commit 56793e5 into spring-cloud:master Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use Resilience4J Bulkhead Module

4 participants