-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support reactive/future HTTP client bodies #11547
base: 4.8.x
Are you sure you want to change the base?
Conversation
@@ -894,16 +896,21 @@ private <I, O, E> Mono<HttpResponse<O>> exchange(io.micronaut.http.HttpRequest<I | |||
AtomicReference<ScheduledExecutorService> scheduler = new AtomicReference<>(connectionManager.getGroup()); | |||
ExecutionFlow<HttpResponse<O>> mono = resolveRequestURI(request).flatMap(uri -> { | |||
MutableHttpRequest<?> mutableRequest = toMutableRequest(request).uri(uri); | |||
Object body = mutableRequest.getBody().orElse(null); | |||
if (body instanceof Publisher<?> publisher) { | |||
return ReactiveExecutionFlow.fromPublisher(publisher).flatMap(resolvedBody -> { |
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.
I think Publisher support also needs multi-element support.
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.
Not sure how we should support it
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.
My vote is that we don't for now. Actually mirroring the server behavior is more complicated than this. But this implementation is not workable, e.g. @Body Publisher<byte[]>
will support streaming on the server but not on the client.
I don't really see how this is useful for the single-element case, cant you just do |
The problem that I’m trying to use an interface API definition, controller works fine but the client is missing this. |
Are all the failures related? |
No description provided.