Browse Source

Update advice on RestTemplate

Closes gh-24503
pull/25011/head
Rossen Stoyanchev 6 years ago committed by Juergen Hoeller
parent
commit
dc561aee02
  1. 14
      spring-web/src/main/java/org/springframework/web/client/RestTemplate.java
  2. 8
      src/docs/asciidoc/integration.adoc
  3. 8
      src/docs/asciidoc/web/webmvc-client.adoc

14
spring-web/src/main/java/org/springframework/web/client/RestTemplate.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2018 the original author or authors. * Copyright 2002-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -70,12 +70,10 @@ import org.springframework.web.util.UriTemplateHandler;
* addition to the generalized {@code exchange} and {@code execute} methods that * addition to the generalized {@code exchange} and {@code execute} methods that
* support of less frequent cases. * support of less frequent cases.
* *
* <p><strong>NOTE:</strong> As of 5.0, the non-blocking, reactive * <p><strong>NOTE:</strong> As of 5.0 this class is in maintenance mode, with
* {@code org.springframework.web.reactive.client.WebClient} offers a * only minor requests for changes and bugs to be accepted going forward. Please,
* modern alternative to the {@code RestTemplate} with efficient support for * consider using the {@code org.springframework.web.reactive.client.WebClient}
* both sync and async, as well as streaming scenarios. The {@code RestTemplate} * which has a more modern API and supports sync, async, and streaming scenarios.
* will be deprecated in a future version and will not have major new features
* added going forward.
* *
* @author Arjen Poutsma * @author Arjen Poutsma
* @author Brian Clozel * @author Brian Clozel
@ -89,7 +87,7 @@ import org.springframework.web.util.UriTemplateHandler;
*/ */
public class RestTemplate extends InterceptingHttpAccessor implements RestOperations { public class RestTemplate extends InterceptingHttpAccessor implements RestOperations {
private static boolean romePresent = private static final boolean romePresent =
ClassUtils.isPresent("com.rometools.rome.feed.WireFeed", ClassUtils.isPresent("com.rometools.rome.feed.WireFeed",
RestTemplate.class.getClassLoader()); RestTemplate.class.getClassLoader());

8
src/docs/asciidoc/integration.adoc

@ -956,10 +956,10 @@ that supports both sync and async, as well as streaming scenarios.
[NOTE] [NOTE]
==== ====
As of 5.0, the non-blocking, reactive `WebClient` offers a modern alternative to the As of 5.0 the `RestTemplate` is in maintenance mode, with only minor requests for
`RestTemplate` with efficient support for both sync and async, as well as streaming changes and bugs to be accepted going forward. Please, consider using the
scenarios. The `RestTemplate` will be deprecated in a future version and will not have <<web-reactive.adoc#webflux-client, WebClient>> which offers a more modern API and
major new features gong forward. supports sync, async, and streaming scenarios.
==== ====

8
src/docs/asciidoc/web/webmvc-client.adoc

@ -15,10 +15,10 @@ libraries.
[NOTE] [NOTE]
==== ====
As of 5.0, the non-blocking, reactive `WebClient` offers a modern alternative to the As of 5.0 the `RestTemplate` is in maintenance mode, with only minor requests for
`RestTemplate` with efficient support for both sync and async, as well as streaming changes and bugs to be accepted going forward. Please, consider using the
scenarios. The `RestTemplate` will be deprecated in a future version and will not have <<web-reactive.adoc#webflux-client, WebClient>> which offers a more modern API and
major new features gong forward. supports sync, async, and streaming scenarios.
==== ====
See <<integration.adoc#rest-client-access,RestTemplate>> for details. See <<integration.adoc#rest-client-access,RestTemplate>> for details.

Loading…
Cancel
Save