GH-2956 Fix assertion for multiple binders

Resolves #2956
This commit is contained in:
Oleg Zhurakousky
2024-06-04 08:36:53 +02:00
parent 7c206241cc
commit d6550ed324

View File

@@ -267,8 +267,8 @@ public abstract class AbstractMessageChannelBinder<C extends ConsumerProperties,
if (binderTypes.entrySet().size() > 1 && getBindingServiceProperties().getDefaultBinder() != null) {
return getBindingServiceProperties().getDefaultBinder();
}
Assert.isTrue(binderTypes.entrySet().size() == 1, "More than one binder types found, but no binder specified on the binding");
return binderTypes.keySet().iterator().next();
Assert.isTrue(binderTypes.entrySet().size() <= 1, "More than one binder types found, but no binder specified on the binding");
return (binderTypes.entrySet().size() < 1) ? null : binderTypes.keySet().iterator().next();
}
/**