Commit Graph

1118 Commits

Author SHA1 Message Date
Arjen Poutsma da4af6157e Added ClientResponse.cookies()
Added cookies() method on ClientResponse, that exposes the response
cookies.

Issue: SPR-15236
2017-02-09 15:04:07 +01:00
Arjen Poutsma 2a512d7b9f Introduce EntityResponse
This commit introduces the EntityResponse, an entity-specific subtype of
ServerResponse that exposes the entity itself.
2017-02-09 13:46:00 +01:00
Brian Clozel 18c04815a7 Add PathPatternRegistry
This commit adds the new `PathPatternRegistry`, which  holds a
sorted set of `PathPattern`s and allows for searching/adding patterns

This registry is being used in `HandlerMapping` implementations and
separates path pattern parsing/matching logic from the rest. Directly
using `PathPattern` instances should improve the performance of those
`HandlerMapping` implementations, since the parsing and generation of
pattern variants (trailing slash, suffix patterns, etc) is done only
once.

Issue: SPR-14544
2017-02-09 11:21:33 +01:00
Andy Clement f58ffad939 Introduce PathPatternParser for optimized path matching
This commit introduces a PathPatternParser which parses request pattern
strings into PathPattern objects which can then be used to fast
match incoming string paths. The parser and matching supports the syntax
as described in SPR-14544. The code is optimized around the common usages
of request patterns and is designed to create very little transient
garbage when matching.

Issue: SPR-14544
2017-02-09 11:09:38 +01:00
Brian Clozel 6f029392c7 Move response status processing in InvocableHandlerMethod
Prior to this commit, WebFlux would look at the handler method
annotations (`@ResponseStatus`) for each handler execution, even calling
the expensive `synthesizeAnnotation`.

This commit moves this logic to the InvocableHandlerMethod so that this
executed once at instantiation time and for all result handlers.

Issue: SPR-15227
2017-02-09 10:30:02 +01:00
Rossen Stoyanchev 9efa976d31 Correct generic type in BodyExtractor for form data 2017-02-08 16:46:58 -05:00
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