Skip to content

CAMEL-23282: fix unbounded BeanInfo cache growth for body OGNL expressions#22437

Open
Croway wants to merge 1 commit intoapache:mainfrom
Croway:ci-issue-CAMEL-23282
Open

CAMEL-23282: fix unbounded BeanInfo cache growth for body OGNL expressions#22437
Croway wants to merge 1 commit intoapache:mainfrom
Croway:ci-issue-CAMEL-23282

Conversation

@Croway
Copy link
Copy Markdown
Contributor

@Croway Croway commented Apr 3, 2026

Summary

  • Always use class-based BeanInfo cache keys instead of instance-based keys
  • Introspection results depend on the class type, not the instance identity
  • Instance-based keys caused cache pollution (1000 duplicate entries for 1 class) and memory leaks for ephemeral message bodies used with OGNL expressions like ${body.name}

Test plan

  • New BeanInfoCacheBodyOgnlTest validates cache stays at 1 entry across multiple messages with body class that has Exchange parameter methods
  • Existing BeanInfoCacheExchangeTest passes
  • All tests pass
    • core/camel-core
    • core/camel-management
    • components/camel-mybatis
    • components/camel-aws/camel-aws-xray
    • components/camel-test/camel-test-junit5
    • dsl/camel-kamelet-main
    • components/camel-bean
    • core/camel-main

…sions

Always use class-based cache keys since introspection results depend on
the class type, not the instance identity. Instance-based keys caused
cache pollution and memory leaks for ephemeral message bodies.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

🌟 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 build-all, build-dependents, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants