diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/bus/DefaultMessageBus.java b/org.springframework.integration/src/main/java/org/springframework/integration/bus/DefaultMessageBus.java index ee35cc51ce..8b8ddfec36 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/bus/DefaultMessageBus.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/bus/DefaultMessageBus.java @@ -104,23 +104,6 @@ public class DefaultMessageBus implements MessageBus, ApplicationContextAware, A this.autoStartup = autoStartup; } - @SuppressWarnings("unchecked") - private void registerChannels(ApplicationContext context) { - Map channelBeans = (Map) context - .getBeansOfType(MessageChannel.class); - for (Map.Entry entry : channelBeans.entrySet()) { - String channelName = entry.getKey(); - MessageChannel previousChannel = this.lookupChannel(channelName); - if (previousChannel == null) { - this.registerChannel(entry.getValue()); - } - else if (!previousChannel.equals(entry.getValue())) { - throw new ConfigurationException("A different channel instance has already " - + "been registered with the name '" + channelName + "'."); - } - } - } - @SuppressWarnings("unchecked") private void registerGateways(ApplicationContext context) { Map gatewayBeans = (Map) context @@ -318,7 +301,6 @@ public class DefaultMessageBus implements MessageBus, ApplicationContextAware, A public void onApplicationEvent(ApplicationEvent event) { if (event instanceof ContextRefreshedEvent) { ApplicationContext context = ((ContextRefreshedEvent) event).getApplicationContext(); - this.registerChannels(context); this.registerGateways(context); if (this.autoStartup) { this.start();