diff --git a/core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/AbstractExtendedBindingProperties.java b/core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/AbstractExtendedBindingProperties.java index c7762668c..0f9b899d0 100644 --- a/core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/AbstractExtendedBindingProperties.java +++ b/core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/AbstractExtendedBindingProperties.java @@ -61,6 +61,8 @@ public abstract class AbstractExtendedBindingProperties bindings) { this.bindings.putAll(bindings); } @@ -83,6 +85,10 @@ public abstract class AbstractExtendedBindingProperties sources = ConfigurationPropertySources.get(this.applicationContext.getEnvironment()); + PropertySourcesPlaceholdersResolver placeholdersResolver = new PropertySourcesPlaceholdersResolver(this.applicationContext.getEnvironment()); + this.propertiesBinder = new Binder(sources, placeholdersResolver, cs, null, null); } /* @@ -99,19 +105,13 @@ public abstract class AbstractExtendedBindingProperties sources = ConfigurationPropertySources.get(this.applicationContext.getEnvironment()); - PropertySourcesPlaceholdersResolver placeholdersResolver = new PropertySourcesPlaceholdersResolver(this.applicationContext.getEnvironment()); - Binder binder = new Binder(sources, placeholdersResolver, cs, null, null); - if (Jsr303Validator.isJsr303Present(this.applicationContext)) { Jsr303Validator validator = new Jsr303Validator(this.applicationContext); - binder.bind(this.getDefaultsPrefix(), + this.propertiesBinder.bind(this.getDefaultsPrefix(), Bindable.ofInstance(extendedBindingPropertiesTarget), new ValidationBindHandler(validator)); } else { - binder.bind(this.getDefaultsPrefix(), + this.propertiesBinder.bind(this.getDefaultsPrefix(), Bindable.ofInstance(extendedBindingPropertiesTarget)); } this.bindings.put(binding, extendedBindingPropertiesTarget);