Commit Graph

814 Commits

Author SHA1 Message Date
Arjen Poutsma
2f682e1035 Polishing 2019-03-20 16:47:27 +01:00
Rossen Stoyanchev
5a3ff35215 Map arg resolver backs out if annotations present
Closes gh-21874
2019-03-19 16:41:26 -04:00
Rossen Stoyanchev
a2fcf0a821 ReactorNettyWebSocketSession uses correct frame size
See gh-22367
2019-03-19 15:42:06 -04:00
Sam Brannen
3e2dbd03b9 Merge branch '5.1.x' 2019-03-19 19:00:12 +01:00
Sam Brannen
ef11aa4583 Update documentation for WebJar support
Prior to this commit, documentation for WebJar support referenced the
webjars-locator artifact; however, Spring now uses the
webjars-locator-core artifact.

This commit updates the documentation to reflect this.

Closes gh-22613
2019-03-19 18:59:03 +01:00
Rossen Stoyanchev
e6d206b45a Extra information in WebFlux stacktraces
Use the checkpoint operator at various places in WebFlux to insert
information that Reactor then uses to enrich exceptions, via suppressed
exceptions, when error signals flow through the operator.

Closes gh-22105
2019-03-15 16:25:43 -04:00
Sebastien Deleuze
495ba2f58c Remove static import from InvocableHandlerMethod
See gh-19975
2019-03-15 19:38:14 +01:00
Sebastien Deleuze
9a81d0276e Fix checkstyle issue 2019-03-15 19:02:33 +01:00
Sebastien Deleuze
1c9cbaf399 Introduce coroutinesVersion
See gh-19975
2019-03-15 18:22:06 +01:00
Sebastien Deleuze
22cf83edba Add support for suspending handler methods in WebFlux
This commit turns Coroutines suspending methods to `Mono` which can be
handled natively by WebFlux.

See gh-19975
2019-03-15 18:21:50 +01:00
stsypanov
29f382b04e Simplify String concatenation 2019-03-14 17:24:33 +01:00
Arjen Poutsma
88ca255c95 Fix checkstyle issue 2019-03-13 11:00:07 +01:00
Rossen Stoyanchev
2d4247b2da Polish 2019-03-12 15:58:25 -04:00
Usman
9f617be909 maxFramePayloadLength property in ReactorNettyWebSocketClient
Closes gh-22367
2019-03-12 15:41:45 -04:00
Juergen Hoeller
ac4c37d8e2 Merge branch '5.1.x' 2019-03-07 18:05:46 +01:00
Juergen Hoeller
6c87ef09c1 Polishing 2019-03-07 17:55:32 +01:00
stsypanov
cb4d6f097c Use StringJoiner where possible to simplify String joining 2019-03-07 16:51:18 +01:00
Juergen Hoeller
5c1776ae8f Merge branch '5.1.x' 2019-03-06 16:26:00 +01:00
Juergen Hoeller
b8f29962ac Upgrade to SLF4J 1.7.26, H2 1.4.198, OkHttp 3.13.1, WebJars Locator 0.37
Includes Mockito 2.25, Undertow 2.0.19, OpenPDF 1.2.10, JRuby 9.2.6.
2019-03-06 16:24:14 +01:00
Johnny Lim
625e210676 Polish 2019-02-25 12:17:53 +01:00
Juergen Hoeller
0652e4b485 Merge branch '5.1.x' 2019-02-22 14:51:00 +01:00
Juergen Hoeller
c3fa900672 Upgrade to Hibernate Validator 5.4.3 and 6.0.15 2019-02-22 14:18:08 +01:00
Brian Clozel
fb66619187 Merge branch '5.1.x' 2019-02-21 17:52:17 +01:00
Brian Clozel
e47f7ef7b5 Remove response content-type before error handling
Prior to this commit, the negotiated content-type during the request
mapping phase would be kept as the response content-type header; this
information is used when rendering the error response and prevents a new
round of content negotiation to choose the media type that fits best.

This commit removes the response content type information at the
beginning of the error handling phase.

Fixes gh-22452
2019-02-21 17:44:03 +01:00
Sebastien Deleuze
19f792db66 Add Coroutines support for WebClient and WebFlux.fn
This commit is the first part of a more complete Coroutines
support coming in Spring Framework 5.2. It introduces suspendable
Kotlin extensions for Mono based methods in WebFlux classes like
WebClient, ServerRequest, ServerResponse as well as a Coroutines
router usable via `coRouter { }`.

Coroutines extensions use `await` prefix or `AndAwait` suffix,
and most are using names close to their Reactive counterparts,
except `exchange` in `WebClient.RequestHeadersSpec`
which translates to `awaitResponse`.

Upcoming expected changes are:
 - Leverage `Dispatchers.Unconfined` (Kotlin/kotlinx.coroutines#972)
 - Expose extensions for `Flux` based API (Kotlin/kotlinx.coroutines#254)
 - Introduce interop with `CoroutineContext` (Kotlin/kotlinx.coroutines#284)
 - Support Coroutines in `ReactiveAdapterRegistry`
 - Support Coroutines for WebFlux annotated controllers
 - Fix return type of Kotlin suspending functions (gh-21058)

See gh-19975
2019-02-18 09:23:31 +01:00
Sebastien Deleuze
1d866053ed Leverage RouterFunctions.Builder in RouterFunctionDsl
Closes gh-22423
2019-02-17 17:20:11 +01:00
Sebastien Deleuze
175c27657e Merge branch '5.1.x' 2019-02-17 10:39:15 +01:00
Ryan Scheidter
6e7c3f2893 Fix a typo in RouterFunctionDsl Javadoc
Closes gh-22419
2019-02-17 09:50:06 +01:00
Brian Clozel
d463598c09 Defer ExchangeFilterFunction to subscription time
Prior to this commit, the `ExchangeFilterFunction` instances configured
on a `WebClient` instance would be executed as soon as the `exchange`
method would be called. This behavior is not consistent with the server
side and can confuse filter developers as they'd need to manually
`Mono.defer()` their implementations if they want to record metrics.

This commit defers all `ExchangeFilterFunction` processing at
subscription time.

Fixes gh-22375
2019-02-12 10:52:49 +01:00
Sebastien Deleuze
0b9522c84e Migrate Kotlin Mockito tests to Mockk
Closes gh-22345
2019-02-05 15:47:08 +01:00
Brian Clozel
862fa557bd Avoid java.util.stream.Stream usage in hot paths
Prior to this commit, profiling sessions would show that using
`java.util.stream.Stream` in some hot code paths creates significant
garbage.

Where streams aren't really required, this commit turns those snippets
into imperative logic  because those are likely to be called once or
multiple times per request.

Closes gh-22341
2019-02-05 12:14:51 +01:00
Juergen Hoeller
165d2511b9 Upgrade to Apache HttpClient 4.5.7 and Commons FileUpload 1.4
Includes RxJava 2.2.6, Netty 4.1.33, Undertow 2.0.17.
2019-02-05 00:46:07 +01:00
Juergen Hoeller
c700ccbc00 Upgrade to Apache HttpClient 4.5.7
Includes Hibernate ORM 5.4.1 for integration tests.
2019-02-05 00:10:40 +01:00
Juergen Hoeller
85ec9b9df2 Avoid Class.getPackage() in favor of plain Class.getName() checks
Fixes #22306
2019-01-25 15:35:49 +01:00
Juergen Hoeller
493e9c1ff0 Consistent upgrade to Rome 1.12 and WebJars Locator 0.36 2019-01-24 15:18:43 +01:00
Brian Clozel
d6aa589c50 Wrap DecodingException in DefaultServerRequest
Prior to this commit, Spring WebFlux function would let
`DecodingException` thrown by codecs bubble up to the web handler level.
Since this exception is not handled by default there, the response would
be turned into a HTTP 500 status.

In the annotation model, `ArgumentResolver` implementations wrap this
exception with a `ServerWebInputException`, which itself extends
`ResponseStatusException`. The latter is supported by the error handling
infrastructure as a HTTP 400 response.

This commit ensures that `DecodingException` instances are properly
wrapped in `ServerWebInputException` at the `ServerRequest` level
directly, thus supporting all setup modes ("standalone" and through the
`DispatcherHandler`).

Fixes #22290
2019-01-22 14:54:44 +01:00
Juergen Hoeller
f56fa91430 Polishing 2019-01-08 17:11:34 +01:00
Juergen Hoeller
d37a18ff03 Upgrade to Hibernate Validator 6.0.14 and Apache Johnzon 1.1.11
Includes OkHttp MockWebServer 3.12.1.
2019-01-08 00:50:44 +01:00
Rossen Stoyanchev
4b24bcb799 More accurate checks for presence of MediaType.ALL
Typically a straight up equals as well as Collections#contains
checks for MediaType.ALL is susceptible to the presence of
media type parameters.

This commits adds equalsTypeAndSubtype as well as an
isPresentIn(Collection<MimeType>) methods to MimeType to faciliate
with checks for MediaType.ALL.

Issue: SPR-17550
2019-01-02 14:32:50 -05:00
Rossen Stoyanchev
1cb9f2c7b2 Explicit HEAD sorted higher than implicit one
Same fix as #7cdcc1 but for WebFlux.

Issue: SPR-14182
2019-01-02 09:23:05 -05:00
Juergen Hoeller
8d1de75b60 Upgrade to WebJars Locator 0.36 and OkHttp 3.12.1
Includes JRuby 9.2.5 and Jetty Reactive HttpClient 1.0.2.
2018-12-25 13:22:17 +01:00
Brian Clozel
6361b0cb23 Write CharSequence instances to DataBuffers
Prior to this commit, one could write a `CharSequence` to an existing
`DataBuffer` instance by turning it into a byte array or `ByteBuffer`
first. This had the following disadvantages:

1. Memory allocation was not efficient (not leveraging pooled memory
when available)
2. Dealing with `CharsetEncoder` is not always easy
3. `DataBuffer` implementations, like `NettyDataBuffer` can use
optimized implementations in some cases

This commit adds a new `DataBuffer#write(CharSequence, Charset)` method
for those cases and also an `ensureCapacity` method useful for checking
that the current buffer has enough capacity to write to it..

Issue: SPR-17558
2018-12-20 21:33:33 +01:00
Juergen Hoeller
0e8ed5931d Revised backport version 5.0.11
Issue: SPR-17410
Issue: SPR-17433
2018-12-17 18:19:21 +01:00
Juergen Hoeller
a240cfcf2f Consistent support for if-(un)modified-since as ZonedDateTime/Instant
Includes DefaultRequestBodyUriSpec pre-resolving URI for HttpRequest.

Issue: SPR-17571
2018-12-17 16:21:39 +01:00
Rossen Stoyanchev
8eef97da33 HTTP header adapters print header values
Issue: SPR-17546
2018-12-12 11:40:33 -05:00
Arjen Poutsma
058608021e Fix invalid String representation for composed RequestPredicates
Issue: SPR-17594
2018-12-12 15:33:33 +01:00
Juergen Hoeller
5bbbc82e19 Consistent handling of null header values in HttpHeaders
Issue: SPR-17588
2018-12-12 11:16:45 +01:00
Kamil Szymanski
894044cea0 Optimize ResourceUrlProvider
Closes gh-2008
2018-12-11 12:12:15 +01:00
Arjen Poutsma
f15bd88211 Fix checkstyle 2018-12-07 15:06:56 +01:00
Arjen Poutsma
3258ac1ec4 Expose request in WebClientResponseException
This commit exposes the request that lead to it in
WebClientResponseException, as a HttpRequest object.

Issue: SPR-17087
2018-12-07 11:08:02 +01:00