在Springboot中rabbitMQ报错在创建rabbitConnectionFactory时不可再销毁时创建bean对象如何解决

在Springboot中rabbitMQ报错在创建rabbitConnectionFactory时不可再销毁时创建bean对象如何解决

问题描述:

报错内容

org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'rabbitConnectionFactory': 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!)

这是该怎么解决啊
img

这个是单例模式的对象,不需要销毁,创建后一直使用就可以了。

百度翻译结果:
org.springframework.beans.factory.BeanCreationNotAllowedException:创建名为“rabbitConnectionFactory”的bean时出错:当此工厂的单例正在销毁时,不允许创建单例bean(不要在销毁方法实现中从BeanFactory请求bean!)
核对你哈你的代码,是不是存在此种操作呢???