spring-fu icon indicating copy to clipboard operation
spring-fu copied to clipboard

Clarify and fix how bean naming/override works

Open sdeleuze opened this issue 3 years ago • 0 comments

Currently in a few places we are invoking BeanDefinitionReaderUtils.uniqueBeanName() "manually" to generate a unique bean name in order to have multiple beans (see for example for having multiple routers here).

It would be nice to be analyze more closely what Spring Boot does

  • Spring Boot by default prevents bean overriding (can be changed via spring.main.allow-bean-definition-overriding=true), we should probably do that as well to avoid silent issues.
  • Maybe some differences come from the fact that we are not using the annotation infrastucture (for example AnnotationBeanNameGenerator or FullyQualifiedAnnotationBeanNameGenerator)
  • There may be inconsistencies between Boot autoconfiguration but let's do our best for now by updating autoconfigure-adapter if needed, this will be fixed in a more structural way via #273.

sdeleuze avatar Jan 27 '21 09:01 sdeleuze