Skip to content

Fix: Resolve duplicate webClientBuilder and restClientBuilder beans#13

Merged
ancongui merged 1 commit into
developfrom
fix/resolve-duplicate-bean-registrations
Feb 13, 2026
Merged

Fix: Resolve duplicate webClientBuilder and restClientBuilder beans#13
ancongui merged 1 commit into
developfrom
fix/resolve-duplicate-bean-registrations

Conversation

@casc84ab

Copy link
Copy Markdown
Contributor

Summary

  • Rename webClientBuilder() to fireflyServiceWebClientBuilder() with explicit @ConditionalOnMissingBean(WebClient.Builder.class) to prevent conflict with WebClientConfig in fireflyframework-core
  • Rename restClientBuilder() to fireflyRestClientBuilder() with @ConditionalOnMissingBean(RestClientBuilder.class) to prevent conflict with Spring Boot's RestClientAutoConfiguration

Test plan

  • All 405 fireflyframework-client tests pass
  • All 36 microservice repos compile and pass tests
  • 29/36 microservices start cleanly with zero duplicate bean warnings

Rename bean methods and add explicit @ConditionalOnMissingBean type checks
to prevent conflicts with Spring Boot's built-in RestClientAutoConfiguration
and WebClientConfig from fireflyframework-core.
@casc84ab casc84ab requested a review from ancongui February 13, 2026 16:00

@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.

LGTM. Two improvements here:

  1. Explicit @ConditionalOnMissingBean type: Changing from bare @ConditionalOnMissingBean (which infers type from factory method return type) to explicit @ConditionalOnMissingBean(WebClient.Builder.class) / @ConditionalOnMissingBean(RestClientBuilder.class) makes the intent clear and avoids subtle inference issues.

  2. Bean method renames: webClientBuilderfireflyServiceWebClientBuilder and restClientBuilderfireflyRestClientBuilder disambiguates from Spring Boot's own beans. Note this changes bean names, but since injection is typically by type (and the conditional checks by type), this is safe. Test plan confirms all 405 tests + 36 microservices pass.

@ancongui ancongui merged commit e56be27 into develop Feb 13, 2026
4 checks passed
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