gnodet opened a new pull request, #22358: URL: https://github.com/apache/camel/pull/22358
## Summary Replace deprecated `Exchange.getOut()`, `Exchange.hasOut()`, and `Exchange.setOut()` calls with the modern `Exchange.getMessage()` API across 32 component files. This is part of the ongoing effort to clean up internal deprecation usage warnings ([CAMEL-22549](https://issues.apache.org/jira/browse/CAMEL-22549)). ### Changes by pattern: - **Simple body/header setting** (`exchange.getOut().setBody(x)` → `exchange.getMessage().setBody(x)`): Most files follow this pattern - **Redundant header copy removal**: Several files were copying IN headers to OUT unnecessarily (e.g., `exchange.getOut().getHeaders().putAll(exchange.getIn().getHeaders())`). Since `getMessage()` returns IN when no OUT exists, these copies are redundant and were removed - **isOutCapable conditional simplification**: `exchange.getPattern().isOutCapable() ? exchange.getOut() : exchange.getIn()` simplified to `exchange.getMessage()` - **Exchange reconstruction**: `UnwrapStreamProcessor` keeps the deprecated API with `@SuppressWarnings("deprecation")` because it copies full exchange state (in/out/properties) which inherently requires the in/out distinction ### Intentionally not changed: - Core processor files (Enricher, PollEnricher, WireTapProcessor, etc.) that rely on the in/out distinction for internal routing semantics - Calls to `getOut()` on non-Exchange objects (e.g., `MethodInfo.getOut()`) ### Affected components: camel-beanio, camel-bindy, camel-chatscript, camel-crypto, camel-crypto-pgp, camel-fop, camel-hl7, camel-influxdb, camel-influxdb2, camel-jcr, camel-jooq, camel-mina, camel-mock, camel-mvel, camel-ognl, camel-reactive-streams, camel-rocketmq, camel-smooks, camel-soap, camel-spring, camel-spring-ws, camel-sql, camel-ssh, camel-stax, camel-xmlsecurity, camel-xpath _Claude Code on behalf of Guillaume Nodet_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
