diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binding/BinderAwareChannelResolver.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binding/BinderAwareChannelResolver.java index 95ec2a88a..879863440 100644 --- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binding/BinderAwareChannelResolver.java +++ b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binding/BinderAwareChannelResolver.java @@ -102,9 +102,6 @@ public class BinderAwareChannelResolver } else { channel = this.bindingTargetFactory.createOutput(channelName); - this.beanFactory.registerSingleton(channelName, channel); - channel = (MessageChannel) this.beanFactory.initializeBean(channel, - channelName); if (this.newBindingCallback != null) { ProducerProperties producerProperties = bindingServiceProperties .getProducerProperties(channelName); @@ -115,6 +112,9 @@ public class BinderAwareChannelResolver bindingServiceProperties.updateProducerProperties(channelName, producerProperties); } + this.beanFactory.registerSingleton(channelName, channel); + channel = (MessageChannel) this.beanFactory.initializeBean(channel, + channelName); Binding binding = this.bindingService .bindProducer(channel, channelName); this.dynamicDestinationsBindable.addOutputBinding(channelName, binding);