saravanakumar1987 opened a new pull request, #31396: URL: https://github.com/apache/camel/pull/31396
# Description Fixes [CAMEL-28121](https://issues.apache.org/jira/browse/CAMEL-28121). ## Summary With `deleteAfterRead=true`, a failed delete of a consumed object reached no exception handler. Camel only logged it at WARN level, also with `bridgeErrorHandler=true`. A failed delete now goes to the exception handler of the consumer, as in camel-alibaba-mns and camel-aws2-s3. - `OSSConsumer.processComplete` takes the exchange, and passes the exception of a failed `deleteObject` with it to `getExceptionHandler()`. - With `bridgeErrorHandler=true`, the error handler of the route gets a copy of that exchange. - The finally block that removes the key from `inProgress` stays, so a later poll can consume the object again. - The upgrade guide has a section on it. ### Why the handler gets the exchange The handler gets the exchange, as in `MNSConsumer.processCommit` and `AWS2S3Consumer.processCommit`. With `bridgeErrorHandler=true`, `BridgeExceptionHandlerToErrorHandler` routes a copy that keeps the `routeStop` flag of the exchange. So nothing handles or logs a failed delete of an exchange that the route ended with `stop()`. ## Tests - `failedDeleteGoesToTheExceptionHandlerOfTheConsumer` checks that a custom `exceptionHandler` gets the failed delete with its exchange, and it failed before the change. - `failedDeleteGoesToTheErrorHandlerOfTheRouteWithBridgeErrorHandler` checks that a dead letter channel gets one copy of the exchange, and it failed before the change. - The module build of camel-alibaba-oss ran 39 tests, none of them skipped, with no failure. - The catalog build ran 156 tests of `CamelCatalogTest`, none of them skipped, with no failure. # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [x] I ran `mvn clean install -Dquickly -DskipTests` on the parent commit, and resumed it from camel-kserve with `-Dgrpc-version=1.85.1`. Then I ran `mvn install -nsu` in camel-alibaba-oss and `mvn install -nsu -Dtest=CamelCatalogTest` in catalog/camel-catalog, and committed all generated changes. # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. _Claude Code on behalf of saravanakumar1987_ 🤖 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]
