Commit Graph

5464 Commits

Author SHA1 Message Date
rstoyanchev
92472a6b62 Merge branch '6.2.x' 2025-01-21 12:23:05 +00:00
rstoyanchev
233f755416 Update Javadoc that links to RestTemplate
Ensure RestClient is mentioned where appropriate.

Closes gh-34270
2025-01-21 12:21:22 +00:00
rstoyanchev
b026680e1c Enhance DisconnectedClientHelper exception type checks
We now look for the target exception types in cause chain as well,
but return false if we encounter a RestClient or WebClient
exception in the chain.

Closes gh-34264
2025-01-21 12:21:22 +00:00
rstoyanchev
e47cc19964 Restore exception phrase in DisconnectedClientHelper
Effectively revert 203fa7, and add implementation comment and tests.

See gh-34264
2025-01-21 12:21:22 +00:00
Sébastien Deleuze
1763334180 Refine KotlinDetector usages and implementation
This commit refines KotlinDetector usages and implementation in order
to remove preliminary KotlinDetector#isKotlinReflectPresent invocations
and to ensure that KotlinDetector methods are implemented safely and
efficiently for such use case.

Closes gh-34275
2025-01-20 12:34:28 +01:00
rstoyanchev
eb15b26abe Add since and forRemoval to @Deprecated 2025-01-16 15:47:52 +00:00
rstoyanchev
5f6df35ec4 Remove deprecated LastModified APIs
See gh-33809
2025-01-16 15:47:45 +00:00
Sébastien Deleuze
94e3b54581 Fix the build
This commit add missing compileOnly jsr305 dependencies.
2025-01-16 08:11:49 +01:00
rstoyanchev
6873427aa7 Merge branch '6.2.x' 2025-01-15 19:04:57 +00:00
rstoyanchev
384d2749c6 Polishing in HttpServiceMethod 2025-01-15 19:03:00 +00:00
rstoyanchev
5150a9a6ad Polishing contribution
Closes gh-34230
2025-01-15 18:31:50 +00:00
Yanming Zhou
a8c5885aff Fix wrong document about RequestHeaderArgumentResolver
Also test is added to verify that.

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>

See gh-34230
2025-01-15 18:31:49 +00:00
rstoyanchev
3b1d14a64d Fix checkstyle warning
See gh-34253
2025-01-15 18:13:42 +00:00
rstoyanchev
75e2e2c3c7 Consistent formatting of forward for host
Closes gh-34253
2025-01-15 17:53:30 +00:00
rstoyanchev
4920086225 Remove deprecated web APIs
See gh-33809
2025-01-15 16:26:16 +00:00
rstoyanchev
83c020eea5 Remove deprecated HttpStatus codes
See gh-33809
2025-01-15 16:26:16 +00:00
rstoyanchev
9f77d5ff1f Remove deprecated ThemeResolver support
See gh-33809
2025-01-15 16:26:16 +00:00
rstoyanchev
9ddbf800b9 Remove deprecated APIs in spring-web
See gh-33809
2025-01-15 16:26:16 +00:00
Simon Baslé
caf84ffe7d Revisit HttpHeadersAssert after HttpHeaders API changes
- add various assertions to HttpHeadersAssert
 - improve assertion test coverage
 - remove niche size assertions

Closes gh-34168

Co-authored-by: Stephane Nicoll <stephane.nicoll@broadcom.com>
2025-01-15 11:42:59 +01:00
Sébastien Deleuze
380c9e318c Specify generic type nullness in spring-web
See gh-34140
2025-01-14 12:35:02 +01:00
Brian Clozel
d28c0396c9 Update runtime hints predicates after GraalVM changes
As of gh-33847, method and field introspection is included by default
when a type is registered for reflection.
Many methods in ReflectionHintsPredicates are now mostly useless as their
default behavior checks for introspection.

This commit deprecates those methods and promotes instead invocation
variants. During the upgrade, developers should replace it for an
`onType` check if only reflection is required. If they were checking for
invocation, they should use the new 'onXInvocation` method.

Closes gh-34239
2025-01-13 15:34:34 +01:00
Stéphane Nicoll
7c4351ab0a Polish
See gh-34231
2025-01-11 12:35:42 +01:00
Brian Clozel
f2a18e5920 Upgrade to Jetty 12.1.0.alpha0
Closes gh-34237
2025-01-10 18:03:10 +01:00
rstoyanchev
39bb751546 Polishing 2025-01-10 14:39:24 +00:00
rstoyanchev
be5542a7a7 Add buffering predicate to RestTemplate
See gh-33785
2025-01-10 14:39:24 +00:00
Sébastien Deleuze
ec48c47886 Make URI template variables nullable
Closes gh-34221
2025-01-10 11:39:21 +01:00
rstoyanchev
07455b10f3 Use response decorator to check if error handled
Closes gh-34231
2025-01-10 10:51:39 +01:00
rstoyanchev
a72855b2b3 DefaultResponseErrorHandler updates
Deprecate handleError(response), and ensure it continues to be invoked
if overridden.

See gh-34231
2025-01-10 10:51:11 +01:00
rstoyanchev
cdddf09c20 Polishing in DefaultResponseErrorHandler
See gh-34231
2025-01-10 10:50:41 +01:00
rstoyanchev
82941caa00 Polishing in DefaultRestClientBuilder
Align order of fields with order of methods on Builder.
2025-01-08 15:52:40 +00:00
rstoyanchev
4b9be5aaf8 Add setBody with byte[] to StreamingHttpOutputMessage
Sometimes the content to write is already buffered, but requires boilerplate
to write through a Body callback.

See gh-33785
2025-01-08 15:52:40 +00:00
rstoyanchev
819a13f22d Apply predicate to BufferingClientHttpRequestFactory
The bufferingPredicate configured in RestClient.Builder can and should also
be used in the (existing) shouldBuffer protected method in
BufferingClientHttpRequestFactory since the factory is no longer intended
for direct use, and in any case the setting should apply in all cases
including when there are no interceptors.

See gh-33785
2025-01-08 15:52:40 +00:00
rstoyanchev
27c4f0e29d Built-in buffering support in RestClient
Closes gh-33785
2025-01-08 13:46:15 +00:00
rstoyanchev
6a0c5ddf68 Refactoring in AbstractBufferingClientHttpRequest
Extract a protected method for subclasses to use to perform the
actual (end-of-chain) request execution.

See gh-33785
2025-01-08 13:46:15 +00:00
rstoyanchev
b9efa91ecc Polishing in client tests 2025-01-08 13:46:15 +00:00
rstoyanchev
3f7d3cbbd3 Add chaining methods to ClientHttpRequestInterceptor
See gh-34169
2025-01-08 13:46:15 +00:00
Brian Clozel
2cdc406e71 Merge branch '6.2.x' 2025-01-07 09:04:05 +01:00
Mattias-Sehlstedt
50b1fb0b15 Change the description for the uri client request observation
This commit describes what parts that are removed from the URI template
keyvalue.

Closes: gh-34116
Signed-off-by: Mattias-Sehlstedt <60173714+Mattias-Sehlstedt@users.noreply.github.com>
2025-01-07 09:02:25 +01:00
Brian Clozel
e8e722fb59 Allow multiple executions of ClientHttpRequestInterceptors
Prior to this commit, an `ClientHttpRequestInterceptor` implementation
could delegate HTTP calls to the next `ClientHttpRequestExecution` only
once. Calling the execution would advance to the next interceptor in the
chain in a mutable fashion for the entire lifetime of the current
exchange.

This commit changes the implementation of `InterceptingClientHttpRequest`
so that a `ClientHttpRequestInterceptor` implementation can call
`ClientHttpRequestExecution#execute` multiple times.

This is especially useful for interceptors in case they want to issue
other HTTP requests without needing another `RestTemplate` or
`RestClient` instance provided out of band.

Closes gh-34169
2025-01-06 19:29:09 +01:00
rstoyanchev
e2ea87fe4f Merge branch '6.2.x' 2025-01-06 12:13:56 +00:00
rstoyanchev
6ec7dcf2c1 Synchronize in WebAsyncManager onError/onTimeout
On connection loss, in a race between application thread and onError
callback trying to set the DeferredResult and dispatch, the onError
callback must not exit until dispatch completes. Currently, it may do
so because the DeferredResult has checks to bypasses locking or even
trying to dispatch if result is already set.

Closes gh-34192
2025-01-06 12:06:43 +00:00
rstoyanchev
d94e04d97a Minor refactoring in WebAsyncManager
There is no need to set the DeferredResult from WebAsyncManager in an
onError notification because it is already done from the Lifecycle
interceptor in DeferredResult.

See gh-34192
2025-01-06 12:06:43 +00:00
rstoyanchev
5a44897c55 Polishing in WebAsyncManager
See gh-34192
2025-01-06 12:06:43 +00:00
Sam Brannen
8bba4f641f Update copyright headers to 2025 2025-01-05 17:02:14 +02:00
Sam Brannen
99bcd3a845 Remove unused code 2025-01-03 17:43:17 +02:00
Sam Brannen
e26c161ae9 Clean up warnings 2025-01-03 17:42:57 +02:00
Brian Clozel
b6de2b0611 Merge branch '6.2.x' 2025-01-02 20:12:14 +01:00
Brian Clozel
d927d64c40 Improve query params in uri KeyValue with HTTP interface client
Prior to this commit, the HTTP interface client would create URI
templates and name query params like so:
"?{queryParam0}={queryParam0[0]}".
While technically correct, the URI template is further used in
observations as a KeyValue. This means that several service methods
could result in having the exact same URI template even if they produce
a different set of query params.

This commit improves the naming of query params in the generated URI
templates for better observability integration.

Closes gh-34176
2025-01-02 20:00:38 +01:00
Sébastien Deleuze
08d7a38546 Merge branch '6.2.x' 2024-12-30 09:06:24 +01:00
Johnny Lim
6d86b23fbe Apply Checkstyle MethodParamPadCheck module
This commit also fixes its violations.

Closes gh-34173
2024-12-30 09:02:06 +01:00