Skip to content

CAMEL-25875: camel-milo - a sessionTimeout configured on the component reaches its endpoints - #28252

Merged
davsclaus merged 1 commit into
apache:mainfrom
etzel-mes:fix/CAMEL-25875-milo-session-timeout
Oct 22, 2026
Merged

davsclaus merged 1 commit into
apache:mainfrom
etzel-mes:fix/CAMEL-25875-milo-session-timeout

Conversation

@etzel-mes

Copy link
Copy Markdown
Contributor

Description

The milo-client and milo-browse components create the configuration of each endpoint with the copy constructor of MiloClientConfiguration, which did not copy sessionTimeout (since the first version of the class). A session timeout configured on the component, for example camel.component.milo-client.sessionTimeout=30000, therefore never reached an endpoint, and its sessions used the Milo default of 120000 ms. Only the endpoint option worked. sessionTimeout was the only field the copy constructor left out.

This copies it. A sessionTimeout set on the endpoint still wins over the component's.

Tests: SessionTimeoutConfigurationTest, for both components: the component value reaches the endpoint, and the endpoint option overrides it. Both tests fail without the fix with expected: <30000> but was: <null>.

Docs: the 4.24 upgrade note. The option is already documented as a component option, so nothing is generated.

Fixes CAMEL-25875.

@davsclaus @oscerd

Target

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • 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.

AI-assisted contributions

  • 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 etzel-mes

@gnodet-bot gnodet-bot 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.

LGTM. Clean, minimal fix.

The one-line addition to the copy constructor is the correct fix — sessionTimeout was the only field missing from the copy. Tests cover both the component→endpoint propagation path and the endpoint-level URI override. The upgrade note in camel-4x-upgrade-guide-4_24.adoc accurately describes the prior behavior and the fix.

Metadata suggestion: this is a long-standing silent bug (session timeout silently ignored since the class was introduced). Consider adding a port/camel-4.22.x label — it is a low-risk, high-value backport candidate.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@etzel-mes

Copy link
Copy Markdown
Contributor Author

Thanks. I cannot set labels on this repository, so I leave the port labels to a committer. The copy constructor misses sessionTimeout on camel-4.22.x and camel-4.18.x too. This commit does not cherry-pick cleanly there, because its context line reconnectTimeout (CAMEL-25873) exists only on main, but the fix is the same one line. I can open the port PRs if you want them.

Claude Code on behalf of etzel-mes

@davsclaus davsclaus added the port/camel-4.22.x Bug needs porting to camel-4.22.x label Oct 21, 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 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-milo
  • docs

🔁 1 test passed only after a retry on JDK 21 (1 retried attempt)

Recovered flaky tests on JDK 21 (1)
Module Test Failed attempts First failure
dsl/camel-jbang/camel-jbang-plugin-tui LaunchManagerOutcomeTest.startedWhenTheStatusFileSaysSo 1 expected: null but was: LaunchOutcome[ok=false, log=null]

ℹ️ These tests did not fail the build. Surefire retried them and they passed.
Retries are enabled project-wide by surefire.rerunFailingTestsCount in parent/pom.xml.


🔬 Scalpel shadow comparison — Scalpel: 8 of 707 tested, 26 compile-only — current: 8 all tested

Maveniverse Scalpel detected 8 affected modules (current approach: 8).

Skip-tests mode would test 8 modules (2 direct + 7 downstream), skip tests for 26 (generated code, meta-modules)

Modules Scalpel would test (8)
  • camel-jbang-mcp ← downstream of org.apache.camel:camel-catalog
  • camel-jbang-plugin-mcp ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-tui ← downstream of org.apache.camel:camel-catalog
  • camel-jbang-plugin-validate ← downstream of org.apache.camel:camel-yaml-dsl-validator
  • camel-launcher-container ← downstream of org.apache.camel:camel-launcher
  • camel-milo ← components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java, components/camel-milo/src/test/java/org/apache/camel/component/milo/SessionTimeoutConfigurationTest.java
  • camel-yaml-dsl-validator ← downstream of org.apache.camel:camel-catalog
  • camel-yaml-dsl-validator-maven-plugin ← downstream of org.apache.camel:camel-yaml-dsl-validator
Modules with tests skipped (26)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

All tested modules (35 modules, 5m 49s total)

Total reactor time: 5m 49s

Module Duration Status
Camel :: Launcher 51.9s SUCCESS
Camel :: JBang :: MCP 43.9s SUCCESS
Camel :: JBang :: Plugin :: Validate 30.5s SUCCESS
Camel :: YAML DSL 25.4s SUCCESS
Camel :: Catalog :: Camel Catalog 24.8s SUCCESS
Camel :: YAML DSL :: Validator 24.1s SUCCESS
Camel :: Component DSL 19.9s SUCCESS
Camel :: Docs 14.8s SUCCESS
Camel :: JBang :: Plugin :: Testing 14.3s SUCCESS
Camel :: Kamelet Main 13.9s SUCCESS
Camel :: JBang :: Plugin :: Kubernetes 13.6s SUCCESS
Camel :: Catalog :: Camel Report Maven Plugin 11.7s SUCCESS
Camel :: Catalog :: Camel Route Parser 8.8s SUCCESS
Camel :: YAML DSL :: Deserializers 8.7s SUCCESS
Camel :: Catalog :: Suggest (deprecated) 7.0s SUCCESS
Camel :: YAML DSL :: Validator Maven Plugin 6.8s SUCCESS
Camel :: All Components Sync point 6.3s SUCCESS
Camel :: YAML DSL :: Maven Plugins 3.8s SUCCESS
Camel :: Catalog :: Maven 3.2s SUCCESS
Camel :: Endpoint DSL :: Support 2.4s SUCCESS
Camel :: Assembly 2.0s SUCCESS
Camel :: JBang :: Plugin :: Edit 1.9s SUCCESS
Camel :: Catalog :: Dummy Component 1.8s SUCCESS
Camel :: JBang :: Integration tests 1.3s SUCCESS
Camel :: Coverage 1.2s SUCCESS
Camel :: JBang :: Plugin :: Generate 1.1s SUCCESS
Camel :: Catalog :: Console 1.0s SUCCESS
Camel :: JBang :: Main 0.9s SUCCESS
Camel :: JBang :: Plugin :: MCP 0.8s SUCCESS
Camel :: Launcher :: Container 0.8s SUCCESS
Camel :: Endpoint DSL n/a
Camel :: Integration Tests n/a
Camel :: JBang :: Core n/a
Camel :: JBang :: Plugin :: TUI n/a
Camel :: Milo n/a

Top 20 slowest modules:

  • Camel :: Launcher (51.9s)
  • Camel :: JBang :: MCP (43.9s)
  • Camel :: JBang :: Plugin :: Validate (30.5s)
  • Camel :: YAML DSL (25.4s)
  • Camel :: Catalog :: Camel Catalog (24.8s)
  • Camel :: YAML DSL :: Validator (24.1s)
  • Camel :: Component DSL (19.9s)
  • Camel :: Docs (14.8s)
  • Camel :: JBang :: Plugin :: Testing (14.3s)
  • Camel :: Kamelet Main (13.9s)
  • Camel :: JBang :: Plugin :: Kubernetes (13.6s)
  • Camel :: Catalog :: Camel Report Maven Plugin (11.7s)
  • Camel :: Catalog :: Camel Route Parser (8.8s)
  • Camel :: YAML DSL :: Deserializers (8.7s)
  • Camel :: Catalog :: Suggest (deprecated) (7.0s)
  • Camel :: YAML DSL :: Validator Maven Plugin (6.8s)
  • Camel :: All Components Sync point (6.3s)
  • Camel :: YAML DSL :: Maven Plugins (3.8s)
  • Camel :: Catalog :: Maven (3.2s)
  • Camel :: Endpoint DSL :: Support (2.4s)

⚙️ View full build and test results

@davsclaus davsclaus 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.

Thanks etzel-mes, the fix is right. sessionTimeout was the only field the copy constructor left out (allowedSecurityPolicies is copied as a new set, everything else field by field), and the copy constructor is what MiloClientComponent and MiloBrowseComponent use for each endpoint. The tests cover both components and the endpoint override, and they fail without the fix.

  1. Blocking: the PR conflicts with main in camel-4x-upgrade-guide-4_24.adoc. It is not another milo PR: CAMEL-25879 (#28174) added the note "camel-infinispan - the key option of the producer takes precedence over the key header" at the same spot, right after the milo reconnectTimeout note. Please rebase and keep both notes, with this one directly after the milo reconnectTimeout note so the milo notes stay together. #28254 also edits this file, but in other milo sections, so it should not conflict again whichever is merged first.
  2. Optional: the copy constructor lost a field since its first version and nothing noticed. A small test that sets every field of a MiloClientConfiguration to a non-default value, copies it and compares field by field through reflection would catch the next option that is added to the class but not to the copy constructor. Fine as a follow-up.

LGTM once rebased and the build jobs are green.

Claude Code on behalf of davsclaus. This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

…t reaches its endpoints

The copy constructor of MiloClientConfiguration, which the milo-client and milo-browse components use to
create the configuration of each endpoint, did not copy sessionTimeout, so a session timeout configured on the
component never reached an endpoint and Milo's default applied.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@etzel-mes
etzel-mes force-pushed the fix/CAMEL-25875-milo-session-timeout branch from fec9c73 to 8d830e7 Compare October 22, 2026 06:07
@etzel-mes

Copy link
Copy Markdown
Contributor Author

Thanks @davsclaus. Rebased onto main (8d830e7): the sessionTimeout note now follows the milo reconnectTimeout note directly, and the camel-infinispan note comes after it. The code change is unchanged, and SessionTimeoutConfigurationTest passes on the new base. I leave the copy-constructor reflection test out of this PR.

Claude Code on behalf of etzel-mes

@davsclaus davsclaus 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.

Thanks Serdar,

  1. Blocking point addressed: the rebase fixes the conflict. A range-diff against fec9c73 shows only the context of the upgrade guide changed. The sessionTimeout note now comes directly after the milo reconnectTimeout note, and the camel-infinispan note of CAMEL-25879 follows it. The copy constructor fix and SessionTimeoutConfigurationTest are unchanged. The PR merges cleanly with main and with #28254.
  2. Optional point (the reflection test for the copy constructor): fine to leave it for a follow-up, as you said.

There were no inline threads to resolve. LGTM, to merge once CI is green.

Claude Code on behalf of @davsclaus.

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

@davsclaus davsclaus added this to the 4.24.0 milestone Oct 22, 2026
@davsclaus davsclaus added the bug Something isn't working label Oct 22, 2026
@davsclaus
davsclaus merged commit aaf0369 into apache:main Oct 22, 2026
7 checks passed
@gnodet

gnodet commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

🔄 Backport Bot

Conflicts (🤖 agent dispatched to resolve):

  • ⚠️ camel-4.22.x — Cherry-pick conflict in: components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java, docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc

ℹ️ If you push additional commits after /port, use /port again to update the port PRs.

@gnodet

gnodet commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

✅ Backport to camel-4.22.x created: #28316

@gnodet gnodet removed the port/camel-4.22.x Bug needs porting to camel-4.22.x label Oct 22, 2026
@etzel-mes
etzel-mes deleted the fix/CAMEL-25875-milo-session-timeout branch October 23, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working components docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants