Open ZIRAKrezovic opened 1 month ago
@ZIRAKrezovic - yes, it's there; you can use a WebClient
instance created with @LoadBalanced WebClient.Builder
to achieve this. You can also use it as the base of client for Spring Interface Clients if you do not want to work directly with the reactive API.
Yes, I personally use web client, but sadly not everybody wants webflux as a dependency in webmvc application.
Describe the bug
This is basically present in anything that implements a
ClientRequestInterceptor
. See the original bug report for Spring Framework, along with reproducer that uses spring-cloud-starter-loadbalancer and SimpleLoadBalancer.As it turns out, adding a
ClientRequestInterceptor
to aRestClient
orRestTemplate
results in it being wrapped in "Buffering" factory rather than "Streaming" factory, effectively breaking the streaming functionality required for large file upload. This makes usage of load balancer client unsuitable for transferring large files between microservices that communicate via load balancer addresses.Spring framework developer has responded that they have no plan to fix this or provide a solution, as the
ClientRequestInterceptor
contract is fixed.Is there an alternative for spring cloud loadbalancer implementation to implement something other than
ClientRequestInterceptor
and achieve the same functionality?https://github.com/spring-projects/spring-framework/issues/32879 https://github.com/ZIRAKrezovic/spring-multipart-reproducer
Sample If possible, please provide a test case or sample application that reproduces the problem. This makes it much easier for us to diagnose the problem and to verify that we have fixed it.