Allow all discovery implementations to bubble up
Hope that one is chosen by @Conditionals. The tests all pass but this could get hairy when we start to get more discovery implementations.
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
package org.springframework.cloud.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
|
||||
@@ -77,11 +76,9 @@ public abstract class SingleImplementationImportSelector<T> implements
|
||||
}
|
||||
|
||||
if (factories.size() > 1) {
|
||||
String factory = factories.get(0);
|
||||
// there should only every be one DiscoveryClient
|
||||
// there should only ever be one DiscoveryClient, but there might be more than one factory
|
||||
log.warn("More than one implementation " + "of @" + getSimpleName()
|
||||
+ ". Using " + factory + " out of available " + factories);
|
||||
factories = Collections.singletonList(factory);
|
||||
+ " (now relying on @Conditionals to pick one): " + factories);
|
||||
}
|
||||
|
||||
return factories.toArray(new String[factories.size()]);
|
||||
|
||||
Reference in New Issue
Block a user