Fix #365: Remove unnecessary ForageConnectionFactory wrapper#375
Fix #365: Remove unnecessary ForageConnectionFactory wrapper#375JiriOndrusek wants to merge 1 commit into
Conversation
|
Warning Review limit reached
More reviews will be available in 39 minutes and 28 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR removes the ChangesWrapper Abstraction Removal
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@library/jms/forage-jms/src/main/java/io/kaoto/forage/jms/ConnectionFactoryBeanFactory.java`:
- Around line 132-133: The code in ConnectionFactoryBeanFactory calls
newConnectionFactory(cfConfig, name) and immediately passes the result to
camelContext.getRegistry().bind(...) without checking for null; update both
places where newConnectionFactory(...) is used so you first capture the return
in a local variable (e.g., connectionFactory), check if it is null, and only
call camelContext.getRegistry().bind(name, connectionFactory) when non-null —
otherwise either log/warn and skip registration or throw a clear exception
(choose consistent behavior used elsewhere in ConnectionFactoryBeanFactory) to
avoid a runtime NPE when no provider is found.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 390d5547-3fbc-42fd-9834-8c01c8bcab23
📒 Files selected for processing (2)
library/jms/forage-jms-common/src/main/java/io/kaoto/forage/jms/common/ForageConnectionFactory.javalibrary/jms/forage-jms/src/main/java/io/kaoto/forage/jms/ConnectionFactoryBeanFactory.java
💤 Files with no reviewable changes (1)
- library/jms/forage-jms-common/src/main/java/io/kaoto/forage/jms/common/ForageConnectionFactory.java
The ForageConnectionFactory wrapper was serving as unnecessary indirection in the JMS module. It was a simple record that wrapped ConnectionFactory, which was immediately unwrapped at every usage point.
efdd270 to
d4b90c2
Compare
fixes #365
The ForageConnectionFactory wrapper was unnecessary. It was a simple record that wrapped ConnectionFactory, which was immediately unwrapped at every usage point.
Summary by CodeRabbit