Spring WebClient Preferred HttpClient Library? - spring-boot

Spring Webclient supports 3 HttpClient libraries - Reactor Netty, Jetty Rective Http Client, and Apache Http Components .
Which is the most recommended one and in what circumstances?

Related

Spring SOAP Webservice Consumer/Client example using apache HttpClient5

Spring SOAP Webservice Consumer/Client example using apache HttpClient5
Spring SOAP Webservice is still using HttpClient implementation, HttpClient 4.x. When I open the Spring WS API for org.springframework.ws.transport.http.HttpComponentsMessageSender to set ConnectionTimeout, it still uses HttpClient 4.x java classes.
But I am looking for Spring SOAP WebService using apache HttpClient5 component classes.
Can someone help here to provide the equivalent example.
Please dont give me old examples.
I am using Java 17, SpringBoot 3.0.1, Spring-ws-core 4.0.0
I referred internet, here are some of the below URLs
https://hc.apache.org/httpcomponents-client-5.2.x/migration-guide/index.html
https://snehapatil02.medium.com/soap-web-service-client-with-spring-boot-3c7034351c46
How to set timeout in Spring WebServiceTemplate
It is still in the works.
If you really want to use it you can always use the ClientHttpRequestMessageSender, which uses the Spring Framework ClientHttpRequest abstraction, which does support Apache Http Client5.

STOMP Client for Quarkus Websockets

Has anyone found a STOMP client implementation that works with Quarkus Native via web sockets?
I am using Quarkus 2.7.5.Final including io.quarkus:quarkus-websockets-client

Spring reactive Webclient timeout

I was trying to test the default timeout of Spring reactive Webclient .
For that purpose I created a rest endpoint that takes 10 hours to return a response.
I created a rest client using spring reactive Webclient. But I see that the spring Reactive Webclient keeps waiting for 10 hours.
Doesn't spring reactive Webclient has any default timeout?
If you are using Reactor Netty as HTTP client library which is default using Spring WebFlux there is no default response timeout specified. If you would like to configure timeout settings there are multiple options as described in the Projectreactor reference documentation chapter 6.14.

Spring Reactor Web Client use case. replacing RestTemplate with WebClient

I am working on a microservice project where my individual spring boot microservices would be calling themselves and mainly to 3rd party API's to fetch and save data.
Since I am with legacy Spring boot application I can't think of replacing it with Reactor based Microservices.
But I am thinking of replacing My RestTemplate (using for communication with Other MS's and 3rd Party App) with new Spring Reactor Webclient to get some advantages of Async calls.
Is My use case a right candidate for Using Spring reactor WebClient?
Yes, composition of microservice and REST calls is a good use case for WebClient.
Plus Spring Boot 2 will let you combine the Spring MVC starter with the WebFlux starter and interpret that as "you want to run on the servlet stack, but might want to use WebClient sporadically".

How to configure TLS for Netty in a Spring Boot app?

My microservices are using the latest releases of Spring Boot, Spring WebFlux (Undertow), Spring Data MongoDB, Spring Cloud Netflix, and Kotlin...
Now I've setup a demo project to use the new functional interface instead of the annotations in Spring WebFlux. Using Netty with HTTP works fine. However, I cannot find any information how to configure Netty with TLS resp. HTTPS. Any hint is appreciated!
At the time of writing, configuration of TLS with Netty hasn't been implemented. The work is being tracked by this issue.

Resources