Create migration guide from RestTemplate to WebClient
See original GitHub issueThe RestTemplate will be deprecated in a future version and will not have major new features added going forward. https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/client/RestTemplate.html
Could you add a detailed migration guide on how to refactor existing RestTemplate
(which typically is for sync blocking requests) into WebClient
requests (also sync and blocking)?
Because the usual case for WebClient is probably for async requests, but chances are high that if someone refactors to WebClient
he want’s to stick to his synchronous patterns.
Wouldn’t this be a good idea to grab spring users by their hands just now, if it’s planned to deprecate RestTemplate
in future anyhow?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Switching from RestTemplate to WebClient: A Reactive Tale
First, we create a Spring Boot project with the spring-boot-starter-web dependency. <dependency> <groupId>org.springframework.boot</groupId> < ...
Read more >Replacing RestTemplate with WebClient - java - Stack Overflow
To help you I am giving you example how we can replace restTemple with webClient. I hope you have already setup your pom.xml....
Read more >Spring WebClient vs. RestTemplate - Baeldung
Learn how to make server-side HTTP calls using WebClient and RestTemplate.
Read more >Spring Boot: migrating to WebFlux - DECODE
As a replacement for RestTemplate, Spring WebFlux introduces the reactive version, WebClient. public Flux<Student> getStudentsWithClient() {.
Read more >Spring WebClient vs RestTemplate - Comparison and Features
You can create a bean that provides the instance of RestTemplate. You can then @autowire this bean in any class where you plan...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Has there been any progress on this, I could not find a guide at: https://github.com/spring-guides
Team Decision: This is a good idea, it needs to be done. It won’t be part of the Spring Framework reference – to avoid bloating it and also because such a guide would go beyond this projects (e.g. some parts would relate to Boot). It should rather be an independent guide, perhaps under https://github.com/spring-guides, but it makes sense to leave the ticket here for now.