r/SpringBoot • u/zarinfam • Feb 07 '25
Guide RestClient vs. WebClient vs RestTemplate - Using the suitable library to call REST API in Spring Boot
https://medium.com/@zarinfam/restclient-vs-webclient-vs-resttemplate-15655f33e6bc?sk=e5e2d3c2493206f644f6b0fb5b97afb12
u/uwpxwpal Feb 07 '25
RestTemplate isn't deprecated, but isn't being worked on. Use something else.
2
1
u/ronh73 Feb 08 '25
Used Webclient with the block statement in some project but now that this project is upgraded to Spring Framework 6.1 it can be replaced with the new RestClient.
1
u/jaktrik Feb 08 '25
WebClient is for reactive development and RestClient is blocking and was proposed against the use of RestTemplate and many more clients were added to replace template based API like for JdbcTemplate we get JdbcClient
I don't understand why you have to switch to RestClient from WebClient it just doesn't make sense
1
u/ronh73 Feb 08 '25 edited Feb 08 '25
Just to make the code more readable for people who are not familiar with using a reactive API. It's true that it doesn't matter technically.
I used it in only in one project for calling one endpoint and it's not yet in production. The reactive stack is actually not needed within this project.
1
u/Life-Post-3570 Aug 07 '25
Feign - Declarative REST Client
https://docs.spring.io/spring-cloud-openfeign/docs/current/reference/html/
11
u/[deleted] Feb 07 '25 edited Apr 17 '26
Databrokers? nope. Social networks? Also nope. This post was deleted using Redact.
fade aware public salt sip resolute truck childlike theory absorbed