Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fallback strategy to CircuitBreakerClient #4818

Merged
merged 8 commits into from Jun 14, 2023
Merged

Conversation

my4-dev
Copy link
Contributor

@my4-dev my4-dev commented Apr 10, 2023

Motivation:

Described in #4800

Modifications:

  • Add recover method to CircuitBreakerClientBuilder in order to set a fallback logic via a builder method
  • Add a new API to CircuitBreakerClientHandler to check which exception is a circuit breaker exception

Result:

@my4-dev
Copy link
Contributor Author

my4-dev commented May 12, 2023

@ikhoon : Thank you for your advice! I've added the recover method to CircuitBreakerRpcClientBuilder and applied your advice.

Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

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

Mostly, looks good.

@ikhoon ikhoon added this to the 1.24.0 milestone May 16, 2023
@my4-dev
Copy link
Contributor Author

my4-dev commented May 17, 2023

@ikhoon : Thanks, I've applied all of your advice.

Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

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

Thanks, @my4-dev! Left minor comments about annotations.

@my4-dev
Copy link
Contributor Author

my4-dev commented May 24, 2023

Thanks for reviewing. I fixed it!

Copy link
Member

@trustin trustin left a comment

Choose a reason for hiding this comment

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

👍👍👍

Copy link
Contributor

@jrhee17 jrhee17 left a comment

Choose a reason for hiding this comment

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

Looks good 👍 Thanks @my4-dev 🙇 👍 🚀

Copy link
Member

@minwoox minwoox left a comment

Choose a reason for hiding this comment

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

Looks great!
Left some nits. 😄

this.fallback = fallback;
return this;
}

@Override
public String toString() {
return MoreObjects.toStringHelper(this).omitNullValues()
Copy link
Member

Choose a reason for hiding this comment

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

nit: We also need to add fallback to this method.
Or we can just remove toString() method of builders, which I prefer. 😉

Copy link
Contributor

Choose a reason for hiding this comment

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

toString() method is removed.

Copy link
Member

@minwoox minwoox left a comment

Choose a reason for hiding this comment

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

Thanks a lot, @my4-dev! 👍 🙇

@minwoox minwoox merged commit 660b2c3 into line:main Jun 14, 2023
13 checks passed
@minwoox
Copy link
Member

minwoox commented Jun 14, 2023

Thanks, again @my4-dev!

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.

Add fallback strategy to CircuitBreakerClient
5 participants