Add @ConditionalOnMissingBean guard to StepEventPublisherBridge bean#9
Add @ConditionalOnMissingBean guard to StepEventPublisherBridge bean#9casc84ab wants to merge 1 commit into
Conversation
Prevent duplicate StepEventPublisher bean registration when multiple bridge modules (core, domain, data) are on the classpath. The condition checks for the StepEventPublisher interface type to detect beans from any bridge implementation.
ancongui
left a comment
There was a problem hiding this comment.
Code Review: Add @ConditionalOnMissingBean guard to StepEventPublisherBridge bean
Summary
This PR adds @ConditionalOnMissingBean(type = "org.fireflyframework.transactional.saga.events.StepEventPublisher") to the stepEventPublisherBridge() bean method in StepBridgeConfiguration (data module). Same pattern as the domain module PR.
CI Status
✅ All checks pass (CodeQL, build)
Findings
1. Consistent with domain module PR (Severity: None — good)
Uses the exact same annotation with the same string-based type reference as the domain module. This consistency is good.
2. Same observations as domain PR apply
- String-based type reference is correct
- Interface-level condition is well designed
@Primary+@ConditionalOnMissingBeanis slightly redundant but not harmful- Auto-configuration ordering should be considered for deterministic behavior
Recommendation
APPROVE — Identical pattern to the domain PR. Clean, correct, and follows established conventions.
|
Closing: the StepBridgeConfiguration fix references the renamed org.fireflyframework.transactional namespace. The bean guard is already addressed in the current develop branch with the orchestration namespace refactoring. |
Summary
@ConditionalOnMissingBean(type = "org.fireflyframework.transactional.saga.events.StepEventPublisher")toStepBridgeConfiguration.stepEventPublisherBridge()to prevent duplicate bean registration.StepEventPublisherinterface type to detect beans from any bridge implementation (core, domain, or data).Test plan
fireflyframework-dataon classpathfireflyframework-dataandfireflyframework-coreon classpath