Skip to content

CAMEL-23550: Fix bean lookup in route templates to check local repository#23312

Merged
davsclaus merged 2 commits into
apache:mainfrom
cunningt:abstractreifierissue
May 19, 2026
Merged

CAMEL-23550: Fix bean lookup in route templates to check local repository#23312
davsclaus merged 2 commits into
apache:mainfrom
cunningt:abstractreifierissue

Conversation

@cunningt
Copy link
Copy Markdown
Contributor

Summary

Fixes bean lookup in route templates by checking the RouteTemplateContext's local bean repository before falling back to the global registry.

Kamelets defining beans via the beans: section store them in a local bean repository scoped to the RouteTemplateContext. Previously, the AbstractReifier only checked EndpointHelper.resolveReferenceParameter and the global registry, causing NoSuchBeanException when route templates tried to reference their locally-defined beans.

This fix adds a lookup step that checks the local bean repository (if present) before falling back to the global registry, allowing Kamelets to properly reference their own beans.

Affected Components

  • Multiple Kamelets in the catalog: protobuf-deserialize-action, protobuf-serialize-action, avro-deserialize-action, avro-serialize-action, data-type-action

Test Plan

  • Build passes with mvn clean install
  • Integration tests in camel-kamelets project (ProtobufIT) verify the fix

🤖 Generated with Claude Code on behalf of Tom Cunningham

…tory first

Kamelets defining beans via the beans: section store them in a local bean repository
scoped to the RouteTemplateContext. The reifier now checks this local repository before
falling back to the global registry, allowing route templates to reference their own beans.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@cunningt cunningt requested review from davsclaus and gnodet May 19, 2026 02:28
@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 May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 2026

🧪 CI tested the following changed modules:

  • core/camel-core-reifier
  • core/camel-core

ℹ️ Dependent modules were not tested because the total number of affected modules exceeded the threshold (50). Use the test-dependents label to force testing all dependents.

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • core/camel-core: 2 test(s) disabled on GitHub Actions
Build reactor — dependencies compiled but only changed modules were tested (2 modules)
  • Camel :: Core
  • Camel :: Core Reifier

⚙️ View full build and test results

Copy link
Copy Markdown
Contributor

@apupier apupier left a comment

Choose a reason for hiding this comment

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

I think it will be good to add a test case

@cunningt
Copy link
Copy Markdown
Contributor Author

Added test cases and made import / instanceof changes

@davsclaus davsclaus merged commit a842fd6 into apache:main May 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants