Commit Graph

4673 Commits

Author SHA1 Message Date
Brian Clozel 31a62ff8ba Add JMH benchmarks for Protobuf message converter
This commit re-generates the protobuf Java classes with a recent version
of the protoc binary and adds JMH benchmarks that exercise the message
converter for both the reading and writing cases.

See gh-29496
2023-10-20 16:35:21 +02:00
Brian Clozel 631a5d1dc1 Remove support for Protobuf 2.x and protobuf-java-format
Closes gh-31465
2023-10-20 15:05:02 +02:00
rstoyanchev 7271dfed68 Use CopyOnWriteArrayList for beforeCommit actions
Closes gh-27587
2023-10-20 13:21:09 +01:00
rstoyanchev a8019f2d0b Create reusable DisconnectedClientHelper
See gh-26181
2023-10-17 15:52:24 +01:00
Stéphane Nicoll 5c6232e681 Polish "Order modifiers to align with JLS"
See gh-31368
2023-10-17 16:16:58 +02:00
Johnny Lim 919faa2ce2 Order modifiers to align with JLS
This commit also applies Checkstyle ModifierOrder to enforce it.

See gh-31368
2023-10-17 16:13:56 +02:00
Sébastien Deleuze 669c723ae0 Merge branch '6.0.x' 2023-10-17 14:25:33 +02:00
Sébastien Deleuze 875eeabb6f Add a properties setter to ProblemDetail
Mainly to allow Kotlin idiomatic properties assignment.

Closes gh-31430
2023-10-17 14:11:24 +02:00
Stéphane Nicoll 6efc99fdd8 Harmonize BeanRegistrationAotContribution class names 2023-10-17 12:37:52 +02:00
Sam Brannen 32b4f55d92 Update copyright headers 2023-10-16 16:19:55 +02:00
Sam Brannen d43cf2c5cd Polishing 2023-10-13 18:12:49 +02:00
Brian Clozel ca4d0d784b Apply instrumentation fixes to HttpWebHandlerAdapter
Since the Spring WebFlux HTTP server instrumentation has been moved from
the `WebFilter` to the `HttpWebHandlerAdapter`, we need to apply similar
changes there.

See gh-31417
2023-10-13 15:04:03 +02:00
Brian Clozel 579f29857f Merge branch '6.0.x' 2023-10-13 15:03:56 +02:00
Brian Clozel da95542d8f Prevent duplicate HTTP server observations
Prior to this commit, HTTP server observations for Spring WebFlux could
be recorded twice for a single request in some cases. The "COMPLETE" and
"CANCEL" signals would race in the reactive pipeline and would trigger
both the `doOnComplete()` and ` `doOnCancel()` operators, each calling
`observation.stop()` on the current observation.
This would in fact publish two different observations for the same
request.

This commit ensures that the instrumentation uses the `Mono#tap`
operator to guard against this case and only call `Observation#stop`
once for each request.

Fixes gh-31417
2023-10-13 14:56:40 +02:00
rstoyanchev b5b9386be6 Polishing
Closes gh-31413
2023-10-13 11:47:47 +01:00
Olga MaciaszekSharma 0cd196e3dd Add UriBuilderFactoryArgumentResolver
See gh-31413
2023-10-13 11:47:47 +01:00
rstoyanchev 0542fe5232 Update ClientHttpRequestInterceptor javadoc
Clarify the interceptor is responsible for closing the response
if it throws an exception after receiving it.

Closes gh-29751
2023-10-11 17:09:18 +01:00
Brian Clozel d1cf71cc70 Merge branch '6.0.x' 2023-10-11 11:24:00 +02:00
Brian Clozel e9fcb21d55 Refine status KeyValue for HTTP server observations
Prior to this commit, a cancelled exchange would always result in an
`"status":"UNKNOWN"` KeyValue. This only applied to reactive variants,
as cancelled exchanges are not currently detected for Servlet
implementations.

In some cases, exchanges can be cancelled by clients before they are
completed, but the response was actually received by the client. The
response status information has been set by the application and the
response has been committed. For those cases, we shouldn't assume an
"UNKNOWN" value.

This commit assumes that committed responses have a response status set
by the application and that the observations should reflect that. From
now on, we only assume an "UNKNOWN" status if the response has not been
commited.

Fixes gh-31388
2023-10-11 11:17:38 +02:00
Sébastien Deleuze 2158410853 Revert "Support Jackson's DatatypeFeature in Jackson2ObjectMapperBuilder"
This reverts commit 5f053401e2.
2023-10-11 10:10:36 +02:00
Sébastien Deleuze ae88bbaac3 Reintroduce org.springframework.http.client.reactive.ReactorResourceFactory
This commit reintroduces a deprecated ReactorResourceFactory in
org.springframework.http.client.reactive package that extends
the one in org.springframework.http.client package to avoid an
API breaking change and to provide a smoother upgrade experience.

Closes gh-31399
2023-10-11 08:38:17 +02:00
Sébastien Deleuze 299a10ce2a Update `@Since` Java doc tags in ReactorResourceFactory
See gh-31399
2023-10-10 16:51:21 +02:00
Sébastien Deleuze e0ba42a80c Move ReactorResourceFactory to org.springframework.http.client package
Closes gh-31399
2023-10-10 15:58:20 +02:00
Arjen Poutsma faaf3a61f2 Add FormEvent stream event test
Add sample that shows how FormEvents can be used to create a form
submit from a stream of key/value pairs.

See gh-30131
2023-10-10 14:08:06 +02:00
Sébastien Deleuze 298d6e4db0 Fix unused import error in ReactorClientHttpConnector 2023-10-10 13:04:32 +02:00
Sébastien Deleuze 955112be0e Polish ReactorClientHttpConnector Javadoc 2023-10-10 12:50:26 +02:00
Sébastien Deleuze 363d5a6413 Add CRaC support to ReactorNettyClientRequestFactory
This commit adds a constructor with externally managed
Reactor Netty resources to ReactorNettyClientRequestFactory
and makes it lifecycle-aware in order to support Project CRaC.

Closes gh-31280
Closes gh-31281
2023-10-10 12:42:56 +02:00
Sébastien Deleuze cd3daa873f Merge branch '6.0.x' 2023-10-10 10:17:02 +02:00
Bram Hagens 5f053401e2 Support Jackson's DatatypeFeature in Jackson2ObjectMapperBuilder
Closes gh-31380
2023-10-10 10:13:52 +02:00
Arjen Poutsma 59d123a18e Introduce OutputStream BodyInserter
This commit introduces a BodyInserter that inssert any bytes written to
an output stream to the body of an output message.

Closes gh-31184
2023-10-05 15:31:08 +02:00
rstoyanchev ef8d1db403 Improve exception handling in startCallableProcessing
Absorb any exception from the submission to the executor. It will be
handled in the resulting ASYNC dispatch.

Closes gh-30232
2023-10-04 13:05:09 +01:00
Kai Zander e8b42c5439 Optimize uses of onErrorResume()
This commit replaces uses of onErrorResume() with
- onErrorMap() in places where onErrorResume() is just used to map to a
  different exception.
- onErrorComplete() where onErrorResume() just maps to Mono.empty().
- onErrorReturn() where onErrorResum() just maps to Mono.just().

Closes gh-31352
2023-10-03 14:42:24 +02:00
Henning Poettker 9cab6c90a9 Allow custom observation convention for RestClient
This commit allows to use a custom `ObservationConvention`
in the `DefaultRestClient`, and to set it through the
`RestClient.Builder`.

Closes gh-31325
2023-10-02 14:55:01 +02:00
rstoyanchev 8fa428f825 Skip reconstructing body from request params if query present
This allows restoring optimization in StringHttpMessageConverter
that was undone in 23162b for 6.0.x.

Closes gh-31327
2023-09-29 18:01:18 +01:00
rstoyanchev a6ab636614 Merge branch '6.0.x' 2023-09-29 18:00:52 +01:00
Sam Brannen 95838e18cc Clean up (boolean) (Boolean) casts in tests 2023-09-29 18:16:04 +02:00
rstoyanchev 23162bb306 Undo optimization from 12fe2c that can cause regression
Closes gh-31327
2023-09-29 17:15:23 +01:00
rstoyanchev a2c5fed494 Make targetType in UknownContentTypeException transient
Closes gh-31283
2023-09-28 16:52:03 +01:00
rstoyanchev 957b6b2caf Use URI String as fallback in ReactorClientHttpConnector
Closes gh-31033
2023-09-27 14:01:35 +01:00
Sam Brannen bc3d98565c Update copyright headers 2023-09-23 13:36:41 +02:00
Brian Clozel d926769a5e Fix copyright headers
See gh-30137
2023-09-22 09:36:38 +02:00
rstoyanchev cc296c5033 Polishing contribution
Closes gh-30137
2023-09-20 18:44:33 +01:00
Joakim Mohn a1c4fb3840 Lenient URI encoding handling in ForwardedHeaderTransformer
See gh-30137
2023-09-20 18:44:33 +01:00
Markus Heiden 59771318ce Introduce CharBufferDecoder
This commit introduces the CharBufferDecoder.

Closes gh-29741
2023-09-19 16:24:07 +02:00
Sam Brannen b05e46d502 Update copyright headers 2023-09-16 15:23:10 +02:00
Sébastien Deleuze 20df52e543 Merge branch '6.0.x' 2023-09-15 18:16:26 +02:00
Sébastien Deleuze ce0923b946 Remove Reactor Netty 2 from integration tests
Closes gh-31243
2023-09-15 18:15:26 +02:00
Arjen Poutsma 81ebc3a6f3 MultipartParser should respect read position
This commit ensures that the MultipartParser takes a buffer's read
position into account.

Closes gh-31110
2023-09-15 14:20:12 +02:00
Arjen Poutsma 8f130316d2 MultipartParser should respect read position
This commit ensures that the MultipartParser takes a buffer's read
position into account.

Closes gh-31110
2023-09-15 13:46:04 +02:00
Stephane Nicoll 01f717375b Introduce ObjectUtils#nullSafeHash(Object... element)
This commit deprecates the various nullSafeHashCode methods taking array
types as they are superseded by Arrays.hashCode now. This means that
the now only remaining nullSafeHashCode method does not trigger a
warning only if the target type is not an array. At the same time, there
are multiple use of this method on several elements, handling the
accumulation of hash codes.

For that reason, this commit also introduces a nullSafeHash that takes
an array of elements. The only difference between Objects.hash is that
this method handles arrays.

The codebase has been reviewed to use any of those two methods when it
is possible.

Closes gh-29051
2023-09-13 15:14:34 +02:00