diff --git a/spring-cloud-stream-docs/src/main/asciidoc/spring-cloud-stream-overview.adoc b/spring-cloud-stream-docs/src/main/asciidoc/spring-cloud-stream-overview.adoc index 8a94c1b35..9898d1cfd 100644 --- a/spring-cloud-stream-docs/src/main/asciidoc/spring-cloud-stream-overview.adoc +++ b/spring-cloud-stream-docs/src/main/asciidoc/spring-cloud-stream-overview.adoc @@ -730,7 +730,7 @@ If your application should connect to more than one broker of the same type, you Turning on explicit binder configuration will disable the default binder configuration process altogether. If you do this, all binders in use must be included in the configuration. Frameworks that intend to use Spring Cloud Stream transparently may create binder configurations that can be referenced by name, but will not affect the default binder configuration. -In order to do so, a binder configuration may have its the `defaultCandidate` flag set to false, e.g. `spring.cloud.stream.binders..defaultCandidate=false`. +In order to do so, a binder configuration may have its `defaultCandidate` flag set to false, e.g. `spring.cloud.stream.binders..defaultCandidate=false`. This denotes a configuration that will exist independently of the default binder configuration process. ==== @@ -766,7 +766,7 @@ spring: === Binder configuration properties The following properties are available when creating custom binder configurations. -They must be prefixed with `spring.cloud.stream.binder.`. +They must be prefixed with `spring.cloud.stream.binders.`. type:: The binder type. diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BinderConfiguration.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BinderConfiguration.java index 2c76cda7a..3cb47fcbf 100644 --- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BinderConfiguration.java +++ b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BinderConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 the original author or authors. + * Copyright 2015-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ package org.springframework.cloud.stream.binder; import java.util.Properties; /** - * * Configuration for a binder instance, associating a {@link BinderType} with its configuration {@link Properties}. * An application may contain multiple {@link BinderConfiguration}s per {@link BinderType}, when connecting to multiple * systems of the same type. @@ -39,9 +38,8 @@ public class BinderConfiguration { /** * @param binderType the binder type used by this configuration * @param properties the properties for setting up the binder - * @param inheritEnvironment whether the binder should inherit the environment of the - * module - * @param defaultCandidate whether the binder is user defined + * @param inheritEnvironment whether the binder should inherit the environment of the application + * @param defaultCandidate whether the binder should be considered as a candidate when determining a default */ public BinderConfiguration(BinderType binderType, Properties properties, boolean inheritEnvironment, boolean defaultCandidate) { 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 76d5a0c37..323080f35 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 @@ -113,9 +113,8 @@ public class DefaultBinderFactory implements BinderFactory, DisposableBean if (defaultCandidateConfigurations.size() > 1) { throw new IllegalStateException( "A default binder has been requested, but there is more than one binder available: " - + StringUtils - .collectionToCommaDelimitedString(defaultCandidateConfigurations) - + ", and" + " no default binder has been set."); + + StringUtils.collectionToCommaDelimitedString(defaultCandidateConfigurations) + + ", and no default binder has been set."); } else { throw new IllegalStateException( @@ -131,7 +130,7 @@ public class DefaultBinderFactory implements BinderFactory, DisposableBean throw new IllegalStateException( "A default binder has been requested, but there is more than one binder available: " + StringUtils.collectionToCommaDelimitedString(this.binderConfigurations.keySet()) - + ", and" + " no default binder has been set."); + + ", and no default binder has been set."); } } } diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/BinderFactoryConfiguration.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/BinderFactoryConfiguration.java index 4ca98989b..8ef20f6f5 100644 --- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/BinderFactoryConfiguration.java +++ b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/BinderFactoryConfiguration.java @@ -52,7 +52,7 @@ public class BinderFactoryConfiguration { @Bean @ConditionalOnMissingBean(BinderFactory.class) - public BinderFactory binderFactory(BinderTypeRegistry binderTypeRegistry, + public BinderFactory binderFactory(BinderTypeRegistry binderTypeRegistry, ChannelBindingServiceProperties channelBindingServiceProperties) { Map binderConfigurations = new HashMap<>(); Map declaredBinders = channelBindingServiceProperties.getBinders(); @@ -71,7 +71,7 @@ public class BinderFactoryConfiguration { } else { Assert.hasText(binderProperties.getType(), - "No 'type' property present for custom " + "binder " + binderEntry.getKey()); + "No 'type' property present for custom binder " + binderEntry.getKey()); BinderType binderType = binderTypeRegistry.get(binderProperties.getType()); Assert.notNull(binderType, "Binder type " + binderProperties.getType() + " is not defined"); binderConfigurations.put(binderEntry.getKey(), @@ -85,7 +85,7 @@ public class BinderFactoryConfiguration { new BinderConfiguration(entry.getValue(), new Properties(), true, true)); } } - DefaultBinderFactory binderFactory = new DefaultBinderFactory<>(binderConfigurations); + DefaultBinderFactory binderFactory = new DefaultBinderFactory<>(binderConfigurations); binderFactory.setDefaultBinder(channelBindingServiceProperties.getDefaultBinder()); return binderFactory; } @@ -126,7 +126,7 @@ public class BinderFactoryConfiguration { String binderType = (String) entry.getKey(); String[] binderConfigurationClassNames = StringUtils .commaDelimitedListToStringArray((String) entry.getValue()); - Class[] binderConfigurationClasses = new Class[binderConfigurationClassNames.length]; + Class[] binderConfigurationClasses = new Class[binderConfigurationClassNames.length]; int i = 0; for (String binderConfigurationClassName : binderConfigurationClassNames) { binderConfigurationClasses[i++] = ClassUtils.forName(binderConfigurationClassName, classLoader);