-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Description
Brian Clozel opened SPR-17242 and commented
When using the bean definition DSL, using the simplest variant of the DSL for defining beans like this creates issues:
val beans = beans {
bean { fooRouter() } // defines a RouterFunction
bean { barRouter() } // defines a RouterFunction
}If no bean name is provided by the bean registration DSL call, GenericApplicationContext.registerBean will register it by default with the bean class name, which means that it's easy to override another definition, and impossible to define multiple beans of the same type without manually defining bean names.
Could we add other strategies that fall back on default bean names, to be more in line with the annotation/XML models? Could we try and derive that information from other parts of the DSL?
Affects: 5.0.8
Reference URL: spring-projects/spring-boot#14295
Issue Links:
- GenericApplicationContext.registerBean should support non-default constructors [SPR-17292] #21825 GenericApplicationContext.registerBean should support non-default constructors
Referenced from: commits b6d32ef