Commit Graph

1262 Commits

Author SHA1 Message Date
Rossen Stoyanchev f2967467e0 Improve writing in mock reactive request and response
Before this change the write Publisher was saved and Mono.empty()
returned from the write metohd which did not properly implement
the write contract since no writing ("consuming") was done.

This can be a problem in some cases. For example the request may appear
to succeed even if the publisher produces an error later when
subscribed to later after request handling completes.

This commit introduces a writeHandler function in the mock request and
response. By default it "writes" by consuming the content immediately,
which allows it to return a Mono<Void> that properly reflects when
writing is done, and it also caches the data so it may be replayed
later for test assertions.

For streaming scenario a custom writeHandler may be registered which
allows the custom handling to determine how long to stream before
cancelling so request handling may complete.

Issue: SPR-14590
2017-02-07 21:57:38 -05:00
Sebastien Deleuze fe05d35292 Polish SseIntegrationTests 2017-02-06 18:24:55 +01:00
Sebastien Deleuze 6b9b0230c4 Introduce JSON streaming support
This commit introduces JSON streaming support which
consists of serializing HTTP request with
application/stream+json media type as line delimited JSON.

It also optimize Flux serialization for application/json by
using flux.collectList() and a single Jackson invocation
instead of one call per element previous strategy.
This change result in a x4 throughput improvement
for collection with a lot of small elements.

Issues: SPR-15095, SPR-15104
2017-02-06 18:14:53 +01:00
Arjen Poutsma 7796c4db14 Introduce RenderingResponse
This commit introduces the RenderingResponse, a template
rendering-specific subtype of ServerResponse that exposes model and
template data.
2017-02-03 11:25:48 +01:00
Eitan Adler 59bba3763d Polish javadoc
Closes gh-1311
2017-02-03 07:36:53 +01:00
Sebastien Deleuze 02c4aff4ce Upgrade to Kotlin 1.1.0-beta-38 2017-02-03 00:33:04 +01:00
Rossen Stoyanchev 1466c82f53 Better support for overriding base URI in WebClient
The base URI is ignored for requests that include a host.

WebClient exposes UriBuilder (rather than UriBuilderFactory) for
per-request URI building based on the base URI. That provides
full control to add or replace components of the base URI.
2017-02-02 17:24:18 -05:00
Rossen Stoyanchev 82a34f4b24 Update WebClient builder
Leave only one static, no-arg build() method for access to a Builder.

URI-related preferences are now exposed on the builder itself.

Improve Javadoc with base URI examples.
2017-02-02 17:17:37 -05:00
Rossen Stoyanchev 7399956708 Rename classes and methods containing "WebReactive"
Issue: SPR-15190
2017-02-02 11:25:54 -05:00
Sebastien Deleuze 123ee5f2da Add WebClient create() and build() static methods 2017-02-02 11:36:45 +01:00
Rossen Stoyanchev 080a3d6a41 Replace use of "Spring MVC" in spring-webflux module
Issue: SPR-15190
2017-02-01 17:50:24 -05:00
Rossen Stoyanchev fafd2d20e1 Rename spring-web-reactive to spring-webflux
Issue: SPR-15190
2017-02-01 17:02:52 -05:00