JinyuChen97 opened a new pull request, #25097:
URL: https://github.com/apache/camel/pull/25097
## Summary
Fix regression where camel export fails with MongoTimeoutException /
AllNodesFailedException for kamelets using #class: Component beans (e.g.
mongodb-sink, cassandra-sink) because the real component is instantiated
instead of being replaced with StubComponent.
The root cause: commit 5d4c6cbf0746 (CAMEL-22667) added an outer else {
accept = true; } branch in KameletMainInjector.acceptComponent(). However, this
branch also impact when stubPattern is "*" (used by camel export), overriding
accept=false back to true for components not in ACCEPTED_STUB_NAMES, causing
real components like MongoDbComponent / CassandraComponent to be loaded and
attempt connections to non-existent instances.
## Changes
KameletMainInjector.java — Removed the outer else { accept = true; } branch
in acceptComponent(). When stubPattern is "*", accept now remains as returned
by accept(type): true for ACCEPTED_STUB_NAMES components, false for everything
else, which can fix the loading non existed instance behavior with camel export.
## Test plan
- New KameletMainInjectorTest verifies that non-whitelisted components are
stubbed with stubPattern=* and "component:*", whitelisted components are
allowed through, and non-Component classes pass unchanged
_Claude Code on behalf of Jinyu Chen_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]