-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Update relevant auto-configurations to ConditionalOnSingleCandidate #2784
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
It's a bit more complicated than I thought since we need to isolate such code in separate |
We really should find a way to make this work. This would allow boot to back off when several instance of a given type is defined rather than blowing up like it does currently. #4678 is another occurrence of this problem. |
Let's talk to @jhoeller about this to see if we can extend the core container support. What we want is a way to plugin strategies to use when multiple candidates are found. Something like @Bean
@ConflictResolver(MyResolver.class)
public MyBean(MyDep dep) {
}
// ...
public class MyResolver implements ExtendedAutowireCandidateResolver {
Dunno resolve(List<SomeContext> candidates) {
/// ...
}
} i.e. Similar to the |
I have been discussing this with @jhoeller today and he gave me a few advices to tune the way the configuration can be architectured. This is WIP but the current tests pass for JMS and AMQP using |
Now that we have a special support for "single candidate" in #1702 we should review our auto-config infrastructure and update conditions accordingly. Anything that configures some sort of template is directly targeted at this.
The text was updated successfully, but these errors were encountered: