Commit 1cfd8a5
GH-10830: Add RestClient support for HTTP outbound endpoints
Fixes: Fixes: #10830
* add `rest-client` XSD attribute for HTTP outbound gateway/channel adapter
* extend XML parsers to wire `RestClient` and reject mixed `rest-template` + `rest-client`
* add `HttpRequestExecutingMessageHandler` constructors and execution path for `RestClient`
* add DSL overloads in `Http` and `HttpMessageHandlerSpec` for preconfigured `RestClient`
* guard local client options (`request-factory`, `error-handler`, `message-converters`, `encoding-mode`) when external client is used
* add parser/DSL/handler tests, including invalid dual-client configuration cases
* update HTTP reference docs (`outbound`, `timeout`, `java-config`) for `RestClient` usage
GH-10830: Deprecate RestTemplate outbound configuration and align with RestClient-first APIs
* deprecate RestTemplate-based constructors and mutators in `HttpRequestExecutingMessageHandler` (`since = "7.1", forRemoval = true`)
* keep current runtime behavior stable in the handler (RestTemplate local path + RestClient external path) to avoid backward-compatibility regressions
* deprecate RestTemplate-based DSL factory methods in `Http` and align `RestClient` methods to `7.1` documentation
* rework `HttpMessageHandlerSpec` to use `RestClient.create(restTemplate)` for RestTemplate-based construction and simplify client state tracking
* deprecate RestTemplate-focused spec mutators (`requestFactory`, `errorHandler`, `messageConverters`) in favor of configuring `RestClient`
* update HTTP reference docs (`java-config`, `outbound`, `timeout`) with 7.1 RestClient guidance and RestTemplate deprecation notes
* adjust related tests/imports to match deprecation and client-selection changes
GH-10830: Align HTTP outbound local client configuration with RestClient.Builder
* keep no-client `HttpRequestExecutingMessageHandler` constructors non-deprecated and use `@SuppressWarnings("removal")` where they delegate to deprecated RestTemplate constructors
* switch local (no external client) setup to `RestClient.Builder` and build the local `RestClient` in `doInit()`
* keep local mutator APIs (`setRequestFactory`, `setErrorHandler`, `setMessageConverters`) and apply them to the local `RestClient.Builder`
* rebuild the local `RestClient` after local mutator updates so post-init changes are visible at runtime
* retain guards that reject local-only options when an external RestTemplate/RestClient is provided
* handle `Void` response type in RestClient exchange path via `toBodilessEntity()` restoring prior behavior for bodiless replies.
* make `restClient` `volatile` because it is rebuilt and read across lifecycle/request threads
* remove deprecations from matching local mutators in `HttpMessageHandlerSpec`
* update outbound/parser/DSL tests to align with local RestClient-backed behavior
* adjust proxy and cookie test fixtures for RestClient path (including non-null request attributes in cookie request stub)
GH-10830: Refine HTTP RestClient delegation and local client lifecycle
* refactor nullable `RestClient` HTTP DSL factory methods to delegate via RestClient-first paths and remove duplicate fallback branches
* add shared `outboundGatewaySpec(...)` helpers in `Http` to centralize URI/String/Expression client selection
* add non-deprecated local constructors in `HttpMessageHandlerSpec` for URI/String/Expression paths
* keep deprecated RestTemplate DSL overloads and add `@SuppressWarnings("removal")` where they intentionally call deprecated constructors
* build local `RestClient` once in `HttpRequestExecutingMessageHandler#doInit()` and stop rebuilding on each local mutator call
* keep local mutators (`setRequestFactory`, `setErrorHandler`, `setMessageConverters`) applying to local `RestClient.Builder`
* align HTTP proxy test flow with lifecycle semantics by re-initializing after mutator-based setup
* revise HTTP proxy/cookie test fixtures and formatting updates for the current RestClient-backed local behavior
* add `[[x7.1-http-changes]]` section to `whats-new.adoc` documenting HTTP 7.1 updates
GH-10830: Refine HTTP RestClient delegation
* route deprecated RestTemplate HTTP DSL/spec paths through RestClient.create(RestTemplate)
* remove deprecated internal-call suppressions in Http factory methods and simplify nullable RestClient delegation
* align HttpRequestExecutingMessageHandler default constructor flow with RestClient-first initialization
* switch local message converter setup to non-deprecated RestClient.Builder.configureMessageConverters API
* update HTTP parser/DSL tests and reduce deprecated-constructor warnings in outbound handler tests
* What's New entry for HTTP RestClient/RestTemplate migration notes
Signed-off-by: Arun Sethumadhavan <[email protected]>1 parent b39f22f commit 1cfd8a5
File tree
23 files changed
+763
-231
lines changed- spring-integration-http/src
- main
- java/org/springframework/integration/http
- config
- dsl
- outbound
- resources/org/springframework/integration/http/config
- test/java/org/springframework/integration/http
- config
- dsl
- outbound
- src/reference/antora/modules/ROOT/pages
- http
23 files changed
+763
-231
lines changedLines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
65 | 83 | | |
66 | 84 | | |
67 | 85 | | |
| |||
97 | 115 | | |
98 | 116 | | |
99 | 117 | | |
| 118 | + | |
100 | 119 | | |
101 | 120 | | |
102 | 121 | | |
| |||
114 | 133 | | |
115 | 134 | | |
116 | 135 | | |
| 136 | + | |
117 | 137 | | |
118 | 138 | | |
119 | 139 | | |
| |||
147 | 167 | | |
148 | 168 | | |
149 | 169 | | |
| 170 | + | |
150 | 171 | | |
151 | 172 | | |
152 | 173 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
81 | 89 | | |
82 | 90 | | |
83 | 91 | | |
84 | 92 | | |
85 | 93 | | |
86 | 94 | | |
87 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
88 | 102 | | |
89 | 103 | | |
90 | 104 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
94 | 102 | | |
95 | 103 | | |
96 | 104 | | |
97 | 105 | | |
98 | 106 | | |
99 | 107 | | |
100 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
101 | 115 | | |
102 | 116 | | |
103 | 117 | | |
| |||
0 commit comments