CAMEL-23652: Fix route template local bean not found when param value matches bean name#23713
Conversation
… matches bean name
When a template parameter value coincidentally matches a local bean name
(e.g., scheme=counter where counter is also a bean), the bean uniqueness
logic removed the bean from the registry but failed to add the bean name
as a template parameter, making {{beanName}} references unresolvable.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
Build reactor — dependencies compiled but only changed modules were tested (2 modules)
|
| assertEquals(1, context.getRoutes().size()); | ||
|
|
||
| Object out = template.requestBody("direct:one", "World"); | ||
| assertEquals(0, out); |
There was a problem hiding this comment.
to ease readability, it would be nice to add a message for assertion explaining why it expects 0
| Object out = template.requestBody("direct:one", "World"); | ||
| assertEquals(0, out); | ||
| out = template.requestBody("direct:one", "World"); | ||
| assertEquals(1, out); |
There was a problem hiding this comment.
to ease readability, it would be nice to add a message for assertion explaining why it expects 1
Summary
{{beanName}}when a template parameter value coincidentally matched the bean namedoStartRouteDefinitions()processes local beans for uniqueness, the first loop detects "clashes" where a parameter value matches a bean key (e.g.,scheme=counterwherecounteris a bean name). It removes the bean from the registry and renames it, but failed to add the original bean name as a template parameter — leaving{{beanName}}references unresolvabletestLocalBeanWithParamValueClashcovering this scenarioTest plan
{{counter}}with a parameterscheme=counterthat coincidentally matchesClaude Code on behalf of Claus Ibsen
🤖 Generated with Claude Code