Only create a new channel for the 'defaultOutputChannelName' if not already present in the registry (and only when 'autocreate' is true).

This commit is contained in:
Mark Fisher
2007-12-24 13:30:54 +00:00
parent aee08797af
commit 2b26ac53f5

View File

@@ -146,7 +146,7 @@ public class MessageBus implements ChannelRegistry, ApplicationContextAware, Lif
}
if (this.autoCreateChannels) {
String defaultOutputChannelName = endpoint.getDefaultOutputChannelName();
if (StringUtils.hasText(defaultOutputChannelName)) {
if (StringUtils.hasText(defaultOutputChannelName) && this.lookupChannel(defaultOutputChannelName) == null) {
this.registerChannel(defaultOutputChannelName, new PointToPointChannel());
}
}