#spring-cloud-stream #spring-cloud-stream-binder-kafka #spring-cloud-bus
#весенний облачный поток #spring-cloud-stream-binder-kafka #весенний облачный автобус
Вопрос:
Мы намерены использовать spring-cloud-bus с kafka в качестве связующего, чтобы уведомлять службы после изменений конфигурации. Все работает нормально, но у нас есть следующее исключение во время завершения работы службы :
WARN 48116 --- [extShutdownHook] o.s.c.support.DefaultLifecycleProcessor : Failed to stop bean 'inputBindingLifecycle'
org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name '****************.errors.bridge': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:207) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1115) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.destroyErrorInfrastructure(AbstractMessageChannelBinder.java:789) ~[spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE]
at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.access$300(AbstractMessageChannelBinder.java:90) ~[spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE]
at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder$2.afterUnbind(AbstractMessageChannelBinder.java:443) ~[spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE]
at org.springframework.cloud.stream.binder.DefaultBinding.unbind(DefaultBinding.java:168) ~[spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE]
at org.springframework.cloud.stream.binding.BindingService.unbindConsumers(BindingService.java:351) ~[spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE]
at org.springframework.cloud.stream.binding.AbstractBindableProxyFactory.unbindInputs(AbstractBindableProxyFactory.java:156) ~[spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE]
at org.springframework.cloud.stream.binding.InputBindingLifecycle.doStopWithBindable(InputBindingLifecycle.java:66) ~[spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE]
at java.base/java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:608) ~[na:na]
at org.springframework.cloud.stream.binding.AbstractBindingLifecycle.stop(AbstractBindingLifecycle.java:68) ~[spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE]
at org.springframework.cloud.stream.binding.InputBindingLifecycle.stop(InputBindingLifecycle.java:34) ~[spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE]
at org.springframework.cloud.stream.binding.AbstractBindingLifecycle.stop(AbstractBindingLifecycle.java:85) ~[spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE]
at org.springframework.cloud.stream.binding.InputBindingLifecycle.stop(InputBindingLifecycle.java:34) ~[spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.doStop(DefaultLifecycleProcessor.java:238) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.access$300(DefaultLifecycleProcessor.java:53) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.stop(DefaultLifecycleProcessor.java:377) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.stopBeans(DefaultLifecycleProcessor.java:210) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.stop(DefaultLifecycleProcessor.java:116) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.stop(AbstractApplicationContext.java:1370) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.doStop(DefaultLifecycleProcessor.java:251) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.access$300(DefaultLifecycleProcessor.java:53) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.stop(DefaultLifecycleProcessor.java:377) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.stopBeans(DefaultLifecycleProcessor.java:210) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.onClose(DefaultLifecycleProcessor.java:128) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1022) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:949) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
Завершение работы завершается через 30 секунд (значение по умолчанию spring.lifecycle.timeoutPerShutdownPhase)
INFO 48116 --- [extShutdownHook] o.s.c.support.DefaultLifecycleProcessor : Failed to shut down 1 bean with phase value 2147482647 within timeout of 30000ms: [inputBindingLifecycle]
Я могу уменьшить значение тайм-аута, но я не думаю, что это правильно.
Я создал аналогичную проблему https://github.com/spring-cloud/spring-cloud-netflix/issues/1064 поднят на проекте spring-cloud-netflix и все еще открыт.
Есть ли какой-либо способ избежать этого исключения?
Мы используем spring boot 2.3.4 и spring cloud Hoxton.SR8.
Заранее спасибо за вашу помощь и отзывы.