davsclaus opened a new pull request, #27014: URL: https://github.com/apache/camel/pull/27014
Fixes [CAMEL-25108](https://issues.apache.org/jira/browse/CAMEL-25108): bugs found in a deep review of the component, endpoint and consumer base classes in camel-support. ## Fixed 1. **With `bridgeErrorHandler=true`, a failed exchange was handled twice.** - If an exchange failed while being routed and the route's error handler had already dealt with it (for example an `onException` that does not mark it as handled), it was bridged to the error handler again. - `onException` and the dead letter channel therefore ran twice for the same failure. The second time, the body had been replaced by the error message. - `BridgeExceptionHandlerToErrorHandler` now only logs an exchange that the error handler has already processed, as happens without the bridge. The bridge error handler is documented for errors that happen while the consumer picks up messages, and those are bridged as before. - This is long-standing; 4.16 and 4.18 behave the same. 2. **A query parameter named `hash` was always removed** by `DefaultComponent`, even when it was a normal parameter (for example for the http components). It is now removed only when the endpoint DSL added it, together with the remaining properties. 3. **With both `bridgeErrorHandler=true` and `exceptionHandler` configured, the `exceptionHandler` was used.** The documentation says it is not used when `bridgeErrorHandler` is enabled; the code now follows that. 4. **`DefaultEndpoint.configureProperties` failed with `NullPointerException`** for an endpoint created without a component, such as a bean. 5. **`getAndRemoveOrResolveReferenceParameter` returned `null` instead of the default value** when the value could not be converted. 6. **`resolveAndRemoveReferenceListParameter` returned a `List` value without resolving its `#bean` references**, for example `List.of("#a", "#b")` from the endpoint DSL. The upgrade guide covers 1, 2 and 3. ## Not changed - `GlobalEndpointConfiguration.setAutowiredEnabled(false)` on its own has no effect. camel-main sets both flags, so this does not matter in practice. - `EndpointHelper.resolveReferenceParameter` does not trim the value. ## Tests - **New `BaseClassesEdgeCasesTest`** (camel-core): all 6 tests fail without the fix. - **Existing tests:** the bridge error handler tests pass, and so does the full camel-core suite. _Claude Code on behalf of Claus Ibsen_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
