-
Notifications
You must be signed in to change notification settings - Fork 785
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
Async feign flow #511
base: 2.2.x
Are you sure you want to change the base?
Async feign flow #511
Conversation
Codecov Report
@@ Coverage Diff @@
## 2.2.x #511 +/- ##
============================================
+ Coverage 77.69% 78.22% +0.53%
- Complexity 521 560 +39
============================================
Files 71 74 +3
Lines 2089 2301 +212
Branches 290 319 +29
============================================
+ Hits 1623 1800 +177
- Misses 327 348 +21
- Partials 139 153 +14
|
Hi @OlgaMaciaszek, any chance that you have checked this PR? |
Hi, @thanhj - will work on it now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, @thanhj thanks for submitting the PR. Have added some comments regarding things that will need to be changed in order to go forward with it, however, we should probably hold on with it still, as I have noticed that AsyncFeign
is still marked as @Experimental
and I am not sure we will want to add support till that changes - discussing it with the team.
@@ -166,6 +190,36 @@ protected void configureFeign(FeignContext context, Feign.Builder builder) { | |||
} | |||
} | |||
|
|||
protected void configureFeign(FeignContext context, AsyncBuilder builder) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The class practically duplicates entire methods, with only small differences. Please refactor it so that this does not happen. You could extract code to smaller methods, use a wrapping interface that could have Builder
or AsyncBuilder
delegate, or use a method with more general arguments and use instanced checks and casting to process the two types, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is true that there are many duplications, I will try to make it better.
...nfeign-core/src/main/java/org/springframework/cloud/openfeign/FeignClientsConfiguration.java
Show resolved
Hide resolved
import org.springframework.context.annotation.Configuration; | ||
|
||
/** | ||
* @author Nguyen Ky Thanh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add description to javadoc.
} | ||
} | ||
|
||
private TlsStrategy clientTlsStrategy(boolean isDisableSslValidation) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the code is similar to what is used by the synchronous version. Could you think of a way of reusing the code instead of duplicating?
import org.springframework.cloud.openfeign.FeignContext; | ||
|
||
/** | ||
* @author Nguyen Ky Thanh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add description to javadoc.
import org.springframework.cloud.openfeign.FeignContext; | ||
|
||
/** | ||
* @author Nguyen Ky Thanh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add description to javadoc.
/** | ||
* Enumeration of pooled connection re-use policies. | ||
*/ | ||
public enum PoolReusePolicy { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot remove public types that have already been released in a non-major release. For example, if we released with org.springframework.cloud.openfeign.support.FeignHttpClientProperties.Hc5Properties.PoolReusePolicy
, we can reuse it or add a new type, but we cannot just remove it (by placing it as an inner type of a different class).
Yes, it is true. But I still hope to receive positive feedback from your team discussion. I believe the |
@thanhj we have just discussed it in the team. We've decided that we would not be merging it to the main SC OpenFeign repo until it's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I would like to. Please let me know how to contribute there. @olegz
...nfeign-core/src/main/java/org/springframework/cloud/openfeign/FeignClientsConfiguration.java
Show resolved
Hide resolved
@thanhj I have created an incubator repo: https://github.com/spring-cloud-incubator/spring-cloud-openfeign-async and already set it up. Please create a PR with your changes. Please add the changes in the |
Thanks @OlgaMaciaszek, I am on it. |
I am not very familiar with setting up a Spring library from scratch like this, so it may take me a bit more time to raise first PR. |
@thanhj Will give it some thought and get back to you with some guidelines. |
No description provided.