Skip to content

Add @ConditionalOnMissingBean guard to StepEventPublisherBridge bean#9

Closed
casc84ab wants to merge 1 commit into
developfrom
fix/step-event-publisher-bean-guard
Closed

Add @ConditionalOnMissingBean guard to StepEventPublisherBridge bean#9
casc84ab wants to merge 1 commit into
developfrom
fix/step-event-publisher-bean-guard

Conversation

@casc84ab

Copy link
Copy Markdown
Contributor

Summary

  • Added @ConditionalOnMissingBean(type = "org.fireflyframework.transactional.saga.events.StepEventPublisher") to StepBridgeConfiguration.stepEventPublisherBridge() to prevent duplicate bean registration.
  • The condition checks for the StepEventPublisher interface type to detect beans from any bridge implementation (core, domain, or data).

Test plan

  • Verify application starts correctly with only fireflyframework-data on classpath
  • Verify application starts correctly with both fireflyframework-data and fireflyframework-core on classpath
  • Confirm only one StepEventPublisher bean is registered when multiple modules are present

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.
@casc84ab casc84ab requested a review from ancongui February 13, 2026 09:55

@ancongui ancongui left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 + @ConditionalOnMissingBean is 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.

@ancongui

Copy link
Copy Markdown
Contributor

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.

@ancongui ancongui closed this Feb 22, 2026
@ancongui ancongui deleted the fix/step-event-publisher-bean-guard branch February 22, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants