后台连接rabbitmq报错

后台启动的时候报错(Connection connect = con.createConnection();这一步的时候创建不了连接):

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rabbitListenerContainerFactory' defined in class path resource [org/ssh/hip/mq/config/MQFramework.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.amqp.rabbit.listener.RabbitListenerContainerFactory]: Factory method 'simpleRabbitListenerContainerFactory' threw exception; nested exception is org.springframework.amqp.AmqpTimeoutException: java.util.concurrent.TimeoutException

网上一直搜不到,最多的都是端口写错了(5672写成15672),但是这个端口配置很久了,之前一直没有问题,在进入rabbitmq后台管理界面的时候,点击overview每次都要很长时间,然后点击其他tab页会有一串红色的字在右上角一闪而过...我拍了个视频然后看到了报错

 然后又去搜这种错误,发现有的人说是因为服务器名字被改了,重装rabbitmq就好了,但这个rabbitmq已经重装三遍了,后来又看到一个博客说优化rabbitmq启动连接慢的问题:https://blog.csdn.net/qq_37606901/article/details/87309881

看到第三步的时候我突然想到之前装集群的rabbitmq的时候也会加这个,就把服务器地址和名字加上了,然后重启rabbitmq...网页点击也快了,程序也能连上了。

越努力越幸运~ 加油ヾ(◍°∇°◍)ノ゙
原文地址:https://www.cnblogs.com/utomboy/p/15547346.html