SpringBoot应用启动后连接RabbitMQ失败

问题描述:

Restarting Consumer: tags=[[]], channel=null, acknowledgeMode=MANUAL local queue size=0

SpringBoot启动后,在RabbitMQ管理界面中无队列创建,查看日志提示信息:

[org.springframework.amqp.rabbit.RabbitListenerEndpointContainer#1-303] ERROR o.s.a.r.listener.SimpleMessageListenerContainer - Failed to check/redeclare auto-delete queue(s).
[AMQP Connection MQ实例主机ip+端口] WARN  com.rabbitmq.client.impl.ForgivingExceptionHandler - An unexpected connection driver error occurred (Exception message: Socket closed)
[org.springframework.amqp.rabbit.RabbitListenerEndpointContainer#1-303] INFO  o.s.a.rabbit.connection.CachingConnectionFactory - Attempting to connect to: [MQ实例主机ip+端口]
[org.springframework.amqp.rabbit.RabbitListenerEndpointContainer#0-302] INFO  o.s.a.r.listener.SimpleMessageListenerContainer - Restarting Consumer: tags=[[]], channel=null, acknowledgeMode=MANUAL local queue size=0
[AMQP Connection MQ实例主机ip+端口] WARN  com.rabbitmq.client.impl.ForgivingExceptionHandler - An unexpected connection driver error occurred (Exception message: Socket closed)
[org.springframework.amqp.rabbit.RabbitListenerEndpointContainer#0-304] INFO  o.s.a.rabbit.connection.CachingConnectionFactory - Attempting to connect to: [MQ实例主机ip+端口]

解决方案:

  1. 检查配置文件中配置的RabbitMQ的host、port、账号密码、virtual-host 填写的是否正确
  2. 在部署应用的服务器上 telnet 一下RabbitMQ的实例,检查网络是否连通
  3. 检查使用的账号的权限是否正常,是否可以自动创建队列
  4. 如果是因为账户权限不够,需要协调提供方实现创建好队列

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值