Spring stream interoperability
This project offers three integrations:
- A
WebClientHttpRequestFactory
that redirects theRestTemplate
API calls to aWebClient
. Doing so, it is possible to use any connector that is written for theWebClient
also withRestTemplate
and to use a single configuration for the client that underlies this web client. - A
JdkClientHttpRequestFactory
for the JDK HTTP client to work withRestTemplate
: while rest template is not (no longer) officially deprecated, its development has become dormant. If theRestTemplate
should be used alongside Spring'sWebClient
, this connector allows to use the same underlying client for both APIs. - Decoders and body inserters/extractors for streams: The
InputStreamDecoder
allows to map the result of a request through theWebClient
to anInputStream
that makes bytes available as they arrive. For this, it must be registered as a codec in the web client's builder, and the stream must be closed to avoid leaking data. Without a codec, it offers similar integrations to read bodys as streams via streams usingStreamBodyExtractors
. And body's can be written to a request usingStreamBodyInserters
.