Skip to content

Conversation

yizhao1998
Copy link

This PR adds the @ConditionalOnMissingBean annotation to the grpcRequestScope bean definition in GrpcServerAutoConfiguration.

Why this change?

  • GrpcRequestScope is already annotated with @Component, meaning it can be registered through component scanning
  • While Spring does not register duplicate beans by default, adding @ConditionalOnMissingBean makes it explicit that this bean is only created if no other GrpcRequestScope instance exists.
  • This improves code clarity and aligns with Spring Boot's best practices for auto-configuration.
  • It ensures better compatibility in cases where GrpcRequestScope might be customized, proxied, or overridden in user applications.

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.

1 participant