GH-1870 Fixed destroy beans logic

- Fixed destroy bean logic in AbstractMessageChannelBinder to ensure that it only destroys beans that are 'reachable' (have bean definitions)

Resolves #1870
This commit is contained in:
Oleg Zhurakousky
2019-12-11 17:09:19 +01:00
parent b06d6f9a0c
commit 61a0c1dc9c

View File

@@ -824,7 +824,7 @@ public abstract class AbstractMessageChannelBinder<C extends ConsumerProperties,
}
private void destroyBean(String beanName) {
if (getApplicationContext().containsBean(beanName)) {
if (getApplicationContext().containsBeanDefinition(beanName)) {
((DefaultSingletonBeanRegistry) getApplicationContext().getBeanFactory())
.destroySingleton(beanName);
((GenericApplicationContext) getApplicationContext())