diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/DefaultBinderFactory.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/DefaultBinderFactory.java index add761836..ae495e5b9 100644 --- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/DefaultBinderFactory.java +++ b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/DefaultBinderFactory.java @@ -122,8 +122,12 @@ public class DefaultBinderFactory implements BinderFactory, DisposableBean, Appl this.defaultBinderForBindingTargetType.put(bindingTargetType.getName(), configurationName); } else { - throw new IllegalStateException("A default binder has been requested, but there is more than " - + "one binder available for '" + bindingTargetType.getName() + "' : " + String countMsg = (candidatesForBindableType.size() == 0) + ? "are no binders" + : "is more than one binder"; + throw new IllegalStateException( + "A default binder has been requested, but there " + countMsg + + " available for '" + bindingTargetType.getName() + "' : " + StringUtils.collectionToCommaDelimitedString(candidatesForBindableType) + ", and no default binder has been set."); }