-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Non-blocking I/O support #361
Comments
I would also like to see this supported. |
+1 |
2 similar comments
+1 |
+1 |
can someone in favor of this describe the api they wish to be non-blocking? or is it simply that they want the buffered http request that's invoked synchronously, to use a non-blocking library underneath? |
First we want to use lib that use nio as underlying implementation. in manner of async API I would like to pass to the feign a callback that will handle the response. in this case the API will return void. |
such a proposal will end up with some severe api changes. Is anyone
interested in working on this? I think there are several related issues
where people ask for the same thing (which is what feign isn't designed
for).
Since we have OpenFeign org now, I'm happy to create a repo for someone to
experiment with this.
IOTW volunteer wanted!
|
What do you mean by "which is what feign isn't designed for"? |
For example, requests are buffered up-front, and all i/o operations are I could go on, but there are a lot of internals that are simpler because Hope this helps. ps the associated issues are #24 #25 #220 as well as others that were |
got it. don't think I can commit to so much work at the moment. |
Hi ! I understand Feign has not been designed with non blocking in mind. Maybe a new project is a better target. I would suggest using reactive stream as a standard way to handle IO events. First I am wondering if there is any proper reactive lightweight HTTP client out there. |
probably want to collaborate on https://github.com/OpenFeign/feign-vertx On Sat, Sep 3, 2016 at 3:24 PM, Daniel Lavoie [email protected]
|
Thanks @adriancole sounds interesting. I'll check it out. |
Hello, Although request support IO is still blocking, response input stream handling can take benefits of java8 streams. |
+1 |
6 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
Please stop |
+1 |
2 similar comments
+1 |
+1 |
+1. |
+1 |
1 similar comment
+1 |
@adriancole - what are the versions of Java that OpenFeign supports? Could this not be completed by having the Client interface return Alternative is to use callbacks i guess and detect them in the parameter list of the feign annotated interface and pass down to the Client. The CompletableFuture feels more clean. |
Hi, I am using spring-cloud-starter-openfeign 2.0.1 and I am trying to make several http API calls asynchronously using org.springframework.scheduling.annotation.EnableAsync and org.springframework.scheduling.annotation.Async on methods annotated with @FeignClient. But none of the methods run async. |
Feign does not support async execution modes currently. You can't do this yet. It's on our road map. |
@kdavisk6 |
I mean that Feign has not been tested or built to support use within any async or non-blocking IO execution mode. The only fully-supported mode is blocking. The one note-able exception is Hystrix, however support is limited to use cases supported by Hystrix, such as using fallbacks and the I'm afraid that's all I can offer you right now. |
Please take a look at the the following pull request |
Does the current version work with CompleteableFuture? |
Yes, it does. The pull request was merged after review and modifications.
This enables the use of async clients with Feign.
On Mon, 28 Sep 2020 at 19:11 王子豪 ***@***.***> wrote:
Does the current version work with CompleteableFuture?
I can't find a use case.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#361 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEAZAM2QANCWRHY7EH5QTK3SICYTRANCNFSM4B6H2G3Q>
.
--
נשלח מ-Gmail לנייד
|
+1 |
Anyone willing to write a first draft for this? |
+1 |
1 similar comment
+1 |
Yeah, still waiting on volunteers to either spear head this initiative or to fund it. |
@velo I worked on coroutine support(#1706) with minimal effort, and now I want to support full asynchronous features, and increase the stability level of AsyncFeign from Experimental to Stable. I'm not knowledgeable perfectly about Feign, but I've seen almost all of the internal implementations of Feign, FeignX, and ReactiveFegin, and I think I can try a few. I plan to
|
@wplong11 feel free to reach me any time you find a blocker |
@velo Do you have any thoughts on what additional work must be done to increase the stability level of AsyncFeign from Experimental to Stable? What I'm thinking of is:
|
@velo @motinis Is the parameter
I have some problem to integrating AsyncFeign and Feign. |
It is possible to use However, for true non-blocking support, we'll need to move past The idea of a |
Does that mean we should discard using CompletableFuture approach, and then use Event Loops? |
It is for use cases where you need different behaviors or isolation.
For example, if an API relies on cookies and those need to be separated per
user. The actual implementation there would be client specific.
On Mon, 10 Oct 2022 at 17:18 Donghyeon Kim ***@***.***> wrote:
@velo <https://github.com/velo> @motinis <https://github.com/motinis> Is
the parameter Optional<C> requestContext important? I understand the
intention, but are you actually using it? It is not being used by
AsyncClient implementation.
https://github.com/OpenFeign/feign/blob/f71849d38746fdc7871bf3b0609c488b36459687/core/src/main/java/feign/AsyncClient.java#L41
I have some problem to integrating AsyncFeign and Feign.
It would be nice if Feign could support non-blocking asynchronous methods
without AsyncFeign as well,
but it's not easy to make appropriate changes while keeping the parameters.
There's room for a little more thought, and I have something to explain
more, but before that, I'd like to ask a quick question.
—
Reply to this email directly, view it on GitHub
<#361 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEAZAM3PW2BHFYORR3TBAALWCQXWFANCNFSM4B6H2G3Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
נשלח מ-Gmail לנייד
|
another yearly what's going on here? |
Same as last year. Needs people to take charge and do it. There was a massive effort by @motinis #1174 , wplong11 #1755 and many others https://github.com/OpenFeign/feign/pulls?q=async Feel free to add your effort into this initiative. I will be here to review, request changes, merge and release. |
There is already library feign-reactive with non-blocking I/O: https://github.com/PlaytikaOSS/feign-reactive |
We probably don't need it anymore since the latest JDK 21 supports virtual threads, if it blocks, let it block. |
Is there anything wrong with this solution? Async call of a FeignClient Springboot with CompletableFuture It seems to be working for me |
this is async flavor programming model from programmer's angle, it's not a non-blocking implementation like nio/aio to improve performance under heavy load. |
As per our discussion with @adriancole in #24 , it would be good to add non-blocking I/O support to Feign.
This can be particularly beneficial for the scenarios with API gateways or microservice API composition.
The text was updated successfully, but these errors were encountered: