WebClient vs RestTemplate

后端 未结 4 1668
青春惊慌失措
青春惊慌失措 2021-01-30 10:45

As per spring 5:

WebClient is an interface representing the main entry point for performing web requests.

It has been created as a part of the Spring

4条回答
  •  抹茶落季
    2021-01-30 11:08

    WebClient is Non-Blocking Client, RestTemplate is Blocking Client.

    For a long time, spring serves as a web customer. Under the hood, RestTemplate uses the Java API API, which is based on the subject model.This means that the matter will be blocked until the client receives a response. The problem with the blockage code is due to the existence of any string of memory and cpu cycles. Let us consider a lot of applications that are waiting for low services that are needed to produce the result.Sooner or later, requests for the results are collected. As a result, the program creates many issues, which result in depletion of a pool of thread or occupying all of the available memory. We can also experience performance performance due to the cpu switching.

    Spring WebClient vs. RestTemplate

提交回复
热议问题