Spring Cloud auto-configuration of Retrofit and OkHttp (with Spring Cloud LoadBalancer).
Apache License 2.0
143
stars
34
forks
source link
Method writeAndFlushWith(body) is not invoked in ClientHttpRequestDecorator when doing a @POST call with request @Body Flux using @RetrofitClient with WebClient #50
Hi guys, @OlgaMaciaszek
I am trying to implement a decorator to ClientHttpRequestDecorator to print some logs using @RetrofitClient @Body with Flux for the request body using WebClient, but it is not working. The method writeWith(body: Publisher) of the decorator is being invoked (actually this method should have been invoked: writeAndFlushWith()) and it doesn't receive correctly the data buffers causing the logs are not printed correctly, only the text {"prefetch":-1} is printed as request body.
Note:The method writeAndFlushWith() is being invoked and works correctly when an http request is invoked directly using WebClient (but We would like to use the component @RetrofitClient and not just the WebClient directly), like this:
We want to know if there is a bug for this scenery or there is not still support for making this type of call: @POST call with request @Body Flux using @RetrofitClient(WebClient)?
Hi guys, @OlgaMaciaszek I am trying to implement a decorator to ClientHttpRequestDecorator to print some logs using @RetrofitClient @Body with Flux for the request body using WebClient, but it is not working. The method writeWith(body: Publisher) of the decorator is being invoked (actually this method should have been invoked: writeAndFlushWith()) and it doesn't receive correctly the data buffers causing the logs are not printed correctly, only the text {"prefetch":-1} is printed as request body.
I am trying with the following Retrofit Client:
Note: The method writeAndFlushWith() is being invoked and works correctly when an http request is invoked directly using WebClient (but We would like to use the component
@RetrofitClient
and not just the WebClient directly), like this:We want to know if there is a bug for this scenery or there is not still support for making this type of call: @POST call with request @Body Flux using @RetrofitClient(WebClient)?
I am looking forward to hearing from you!