allthingssecurity opened a new pull request, #26772: URL: https://github.com/apache/camel/pull/26772
# Description [CAMEL-24925](https://issues.apache.org/jira/browse/CAMEL-24925) `onException(...).redeliveryDelay("1s")` (and `maximumRedeliveryDelay`, plus the XML/YAML `redeliveryPolicy` attributes) failed at the first redelivery with `Error parsing [1s] as a java.lang.Long`, replacing the original exception. `ExceptionPolicy` parsed both options with `parseLong`, while the error handler path already uses `parseDuration`. This change: use `CamelContextHelper.parseDuration(...).toMillis()` in `ExceptionPolicy`, and in the deprecated `ErrorHandlerReifier.createRedeliveryPolicy(Map, ...)` copy. Plain numbers keep meaning milliseconds. Tests: new `OnExceptionRedeliveryDelayDurationTest`: - `testDurationRedeliveryDelay`: a route with `redeliveryDelay("10ms").maximumRedeliveryDelay("1s")` makes 3 attempts and keeps the original exception. - `testDurationValues`: `5s` and `1m30s` give 5000 and 90000 ms; `250` stays 250 ms. Without the fix, both fail with the parse error. With the fix, both pass. `*Redeliver*,*ExceptionPolicy*,OnException*,*DeadLetter*`: 281 tests, 0 failures (1 pre-existing skip). Note: like on `errorHandler`, `parseDuration` is more lenient than `parseLong` for malformed values. # 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. - [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. (I built and tested the affected modules, including the formatter and import-sort plugins. I did not run the full root build.) # 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. This PR was prepared with Claude Code (Claude Opus 5.5). The commit carries a `Co-Authored-By` trailer. -- 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]
