gs-consuming-rest icon indicating copy to clipboard operation
gs-consuming-rest copied to clipboard

RestTemplate is being deprecated.

Open dailytabs opened this issue 7 years ago • 5 comments

According to https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/client/RestTemplate.html:

NOTE: As of 5.0, the non-blocking, reactive org.springframework.web.reactive.client.WebClient offers a modern alternative to the RestTemplate with efficient support for both sync and async, as well as streaming scenarios. The RestTemplate will be deprecated in a future version and will not have major new features added going forward.

Anyone care to rewrite this guide for WebClient?

dailytabs avatar Oct 24 '18 15:10 dailytabs

I came here to bring up this same thing, but as I'm just learning, I'm unsure how quickly it needs to be changed.

Regardless, thanks @dailytabs and @gregturn, @Buzzardo and others for your hard work!

UgmaDevelopment avatar Dec 05 '20 03:12 UgmaDevelopment

https://gturnquist-quoters.cfapps.io/api/random returns 404, even in a browser.

bosatsu avatar Jan 31 '21 21:01 bosatsu

https://gturnquist-quoters.cfapps.io/api/random returns 404, even in a browser.

Check out #47 . @ayan-b posted a temporary workaround.

ssjlee93 avatar Mar 31 '22 22:03 ssjlee93

I have heard in a youtube video, that yes it is going to be deprecated.

Kumar2106 avatar Jun 26 '22 14:06 Kumar2106

I was worried too but apparently the wording changed at some point. Does it mean that code that uses it is fine but it is not recommended for new code? Or is it actually just a matter of your requirement and taste?

NOTE: As of 5.0 this class is in maintenance mode, with only minor requests for changes and bugs to be accepted going forward. Please, consider using the org.springframework.web.reactive.client.WebClient which has a more modern API and supports sync, async, and streaming scenarios.

dedeibel avatar Aug 09 '22 07:08 dedeibel

I noted the same as @dedeibel. So I'm curious to know what happens with RestTemplate in the future. To assess whether a migration to WebClient is (already) necessary or not. Can anyone give us more information on this?

rearl avatar Jun 08 '23 07:06 rearl

As folks have noticed, the Spring Team plans to continue to make RestTemplate available as is (but only as-is - only something like a CVE would make us change it). If you need it, use it, but we do recommend WebClient as the modern replacement.

Buzzardo avatar Oct 09 '23 18:10 Buzzardo