You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spring Framework 6.2 has introduced a new type of beans using @Fallback, which complements the existing @Bean(defaultCandidate=false) and this issue is about introducing an API counterpart that would allow one to handle such beans without relying on the BeanFactory.
Spring Boot is using ObjectProvider with convenience method to sort beans according to their order. This abstraction cannot be used as it mimics the behavior of autowiring-by-type. A similar API where we'd be able to continue using the sorting algorithm would be much more welcome.
Our current workaround would be to use this.beanFactory.getBeansOfType(beanType, false, false) but this requires to inject the BeanFactory in infrastructure code that didn't need it previously.
The text was updated successfully, but these errors were encountered:
snicoll
changed the title
Add API counterpart for handling Fallback beans
Add API counterpart for handling Fallback and 'defaultCandidate=false' beans
Jan 7, 2025
Spring Framework 6.2 has introduced a new type of beans using
@Fallback
, which complements the existing@Bean(defaultCandidate=false)
and this issue is about introducing an API counterpart that would allow one to handle such beans without relying on theBeanFactory
.Spring Boot is using
ObjectProvider
with convenience method to sort beans according to their order. This abstraction cannot be used as it mimics the behavior of autowiring-by-type. A similar API where we'd be able to continue using the sorting algorithm would be much more welcome.Our current workaround would be to use
this.beanFactory.getBeansOfType(beanType, false, false)
but this requires to inject theBeanFactory
in infrastructure code that didn't need it previously.The text was updated successfully, but these errors were encountered: