Skip to content

[backport camel-4.22.x] CAMEL-24375: parseDuration should handle plain millis value - #25447

Merged
davsclaus merged 1 commit into
camel-4.22.xfrom
backport/25412-to-camel-4.22.x
Aug 11, 2026
Merged

[backport camel-4.22.x] CAMEL-24375: parseDuration should handle plain millis value#25447
davsclaus merged 1 commit into
camel-4.22.xfrom
backport/25412-to-camel-4.22.x

Conversation

@davsclaus

Copy link
Copy Markdown
Contributor

Backport of #25412

Cherry-pick of #25412 onto camel-4.22.x.

Original PR: #25412 - CAMEL-24375: parseDuration should handle plain millis value
Original author: @davsclaus
Target branch: camel-4.22.x

Original description

Consolidate duration parsing into TimeUtils.toDuration() so both
CamelContextHelper.parseDuration() and DurationConverter.toDuration()
delegate to a single implementation that handles plain millis, human-
readable (20s, 1m30s), and ISO-8601 (PT20S) formats. This fixes
NoTypeConversionAvailableException when parsing duration values during
early route initialization before the type converter registry is loaded.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

Consolidate duration parsing into TimeUtils.toDuration() so both
CamelContextHelper.parseDuration() and DurationConverter.toDuration()
delegate to a single implementation that handles plain millis, human-
readable (20s, 1m30s), and ISO-8601 (PT20S) formats. This fixes
NoTypeConversionAvailableException when parsing duration values during
early route initialization before the type converter registry is loaded.

Closes #25412

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@davsclaus davsclaus added the backport indicate that a Pull request is a backport from a fix from the main branch label Aug 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions github-actions Bot added the core label Aug 11, 2026

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean backport of the already-merged #25412 to camel-4.22.x. The diff is identical to the original — a straightforward cherry-pick with no manual modifications.

The fix correctly addresses the NoTypeConversionAvailableException during early route initialization by calling TimeUtils.toDuration() directly instead of going through the type converter registry (which may not yet be loaded). The ISO-8601 parsing logic consolidation into TimeUtils is sound, and tests cover all key duration formats (plain millis, human-readable, ISO-8601, lowercase, negative, null).

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of @gnodet

@davsclaus
davsclaus merged commit 4720467 into camel-4.22.x Aug 11, 2026
2 checks passed
@davsclaus
davsclaus deleted the backport/25412-to-camel-4.22.x branch August 11, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport indicate that a Pull request is a backport from a fix from the main branch core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants