-
Notifications
You must be signed in to change notification settings - Fork 1
Spring Web Client Implementation
yan li edited this page Nov 10, 2020
·
10 revisions
Spring web client uses two types of web client implementations: Rest Template and WebClient.
Webclient is a reactive, non-blocking solution. Reactive Programming defines the Programming with asynchronous data streams.
WebClient is an interface of the Spring Web Reactive module, will replace the classic RestTemplate. Every request executes the following steps to get response:
* Creating a URL object and opening the connection
* Configuring the HTTP request
* Executing the HTTP request
* Interpretation of the HTTP response
* Converting the HTTP response into a Java object
* Exception handling
RestTemplate is one of the Spring's web client implementation.
ClientHttpResponse must be closed. And any created resources must be freed. e.g.if we tests response, response will be closed by verify(response).
verify(response).close();
https://springframework.guru/spring-5-webclient/