Summary of client-side REST options in MVC section

This commit is contained in:
Rossen Stoyanchev
2017-10-13 13:24:33 -04:00
parent c3cf0840b7
commit 314f3fc547
3 changed files with 39 additions and 10 deletions

View File

@@ -948,14 +948,16 @@ plugging in third-party or custom solutions here.
[[rest-client-access]]
=== Accessing REST endpoints
The Spring Framework offers two choices for client-side access to REST endpoints:
The Spring Framework has two choices for client-side access to REST endpoints:
* <<rest-resttemplate>> -- the original Spring REST client with an API similar to other
template classes in Spring, such as `JdbcTemplate`, `JmsTemplate` and others. The
`RestTemplate` is built for synchronous use with the blocking I/O.
template classes in Spring such as `JdbcTemplate`, `JmsTemplate` and others.
`RestTemplate` has a synchronous API and relies on blocking I/O which is okay for
client scenarios with low concurrency.
* <<web-reactive.adoc#webflux-client,WebClient>> -- reactive client with a functional,
fluent API from the `spring-webflux` module. It is built on a non-blocking foundation
for async and sync scenarios and supports Reactive Streams back pressure.
fluent API from the `spring-webflux` module. It relies on non-blocking I/O which allows it
to support high concurrency more efficiently (i.e. using a small number of threads) than the
`RestTemplate`. `WebClient` is a natural fit for streaming scenarios.
[[rest-resttemplate]]
@@ -966,11 +968,6 @@ that correspond to each of the six main HTTP methods that make invoking many RES
services a one-liner and enforce REST best practices.
[NOTE]
====
RestTemplate has an asynchronous counter-part: see <<rest-async-resttemplate>>.
====
[[rest-overview-of-resttemplate-methods-tbl]]
.Overview of RestTemplate methods
[cols="1,3"]