question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create migration guide from RestTemplate to WebClient

See original GitHub issue

The 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:open
  • Created 4 years ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
billNaylorcommented, Aug 18, 2020

Has there been any progress on this, I could not find a guide at: https://github.com/spring-guides

5reactions
rstoyanchevcommented, Aug 26, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found