StreamBridge resolveDestination considers binderName in cache hit
This commit is contained in:
committed by
Oleg Zhurakousky
parent
6dd6774280
commit
862b2003ab
@@ -271,7 +271,12 @@ public final class StreamBridge implements SmartInitializingSingleton {
|
||||
|
||||
@SuppressWarnings({ "unchecked"})
|
||||
synchronized MessageChannel resolveDestination(String destinationName, ProducerProperties producerProperties, String binderName) {
|
||||
MessageChannel messageChannel = this.channelCache.get(destinationName);
|
||||
MessageChannel messageChannel = null;
|
||||
if (StringUtils.hasText(binderName)) {
|
||||
messageChannel = this.channelCache.get(binderName + " " + destinationName);
|
||||
} else {
|
||||
messageChannel = this.channelCache.get(destinationName);
|
||||
}
|
||||
if (messageChannel == null) {
|
||||
if (this.applicationContext.containsBean(destinationName)) {
|
||||
messageChannel = this.applicationContext.getBean(destinationName, MessageChannel.class);
|
||||
@@ -299,7 +304,11 @@ public final class StreamBridge implements SmartInitializingSingleton {
|
||||
this.addInterceptors((AbstractMessageChannel) messageChannel, destinationName);
|
||||
|
||||
this.bindingService.bindProducer(messageChannel, destinationName, false, binder);
|
||||
this.channelCache.put(destinationName, messageChannel);
|
||||
if (StringUtils.hasText(binderName)) {
|
||||
this.channelCache.put(binderName + " " + destinationName, messageChannel);
|
||||
} else {
|
||||
this.channelCache.put(destinationName, messageChannel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user