diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingAdapterConfiguration.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingAdapterConfiguration.java index 5accd1b4c..0c37dd8e7 100644 --- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingAdapterConfiguration.java +++ b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingAdapterConfiguration.java @@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.support.AbstractBeanDefinition; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.cloud.stream.adapter.ChannelBindingAdapter; import org.springframework.cloud.stream.adapter.DefaultChannelLocator; import org.springframework.cloud.stream.adapter.InputChannelBinding; @@ -50,6 +51,7 @@ import org.springframework.messaging.core.DestinationResolver; * @author Ilayaperumal Gopinathan */ @Configuration +@EnableConfigurationProperties(ChannelBindingProperties.class) public class ChannelBindingAdapterConfiguration { @Autowired diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingPropertiesAutoConfiguration.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingPropertiesAutoConfiguration.java deleted file mode 100644 index ebb477018..000000000 --- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingPropertiesAutoConfiguration.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2015 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.cloud.stream.config; - -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.condition.SearchStrategy; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -/** - * @author Dave Syer - * - */ -@Configuration -@ConditionalOnMissingBean(value = ChannelBindingProperties.class, search = SearchStrategy.CURRENT) -public class ChannelBindingPropertiesAutoConfiguration { - - @Bean(name = "spring.cloud.stream.CONFIGURATION_PROPERTIES") - public ChannelBindingProperties moduleProperties() { - return new ChannelBindingProperties(); - } - -} diff --git a/spring-cloud-stream/src/main/resources/META-INF/spring.factories b/spring-cloud-stream/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 0c865288b..000000000 --- a/spring-cloud-stream/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration:\ -org.springframework.cloud.stream.config.ChannelBindingPropertiesAutoConfiguration \ No newline at end of file diff --git a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/config/ChannelBindingAdapterConfigurationTests.java b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/config/ChannelBindingAdapterConfigurationTests.java index fa1927833..b0f0903d6 100644 --- a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/config/ChannelBindingAdapterConfigurationTests.java +++ b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/config/ChannelBindingAdapterConfigurationTests.java @@ -132,7 +132,7 @@ public class ChannelBindingAdapterConfigurationTests { } @Configuration - @Import({ChannelBindingAdapterConfiguration.class, ChannelBindingPropertiesAutoConfiguration.class}) + @Import({ChannelBindingAdapterConfiguration.class}) protected static class Empty { @Bean public LocalMessageChannelBinder binder() {