随笔 - 632  文章 - 17  评论 - 54  阅读 - 93万

rabbitmq Broker not available; cannot force queue declarations during start: java.util.concurrent.TimeoutException

一、概述

  使用SpringBoot集成RabbitMQ遇到的问题。

2023-09-20 14:19:39.655  INFO 10256 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 80 (http) with context path ''
2023-09-20 14:19:39.656  INFO 10256 --- [  restartedMain] o.s.a.r.c.CachingConnectionFactory       : Attempting to connect to:主机ip:15672
2023-09-20 14:19:44.687  INFO 10256 --- [  restartedMain] o.s.a.r.l.SimpleMessageListenerContainer : Broker not available; cannot force queue declarations during start: java.util.concurrent.TimeoutException
2023-09-20 14:19:44.692  INFO 10256 --- [sageContainer-1] o.s.a.r.c.CachingConnectionFactory       : Attempting to connect to: 主机ip:15672
2023-09-20 14:19:49.704 ERROR 10256 --- [.68.165.5:15672] c.r.c.impl.ForgivingExceptionHandler     : An unexpected connection driver error occurred

 

二、解决办法

  我这里是因为RabbitMQ的web访问端口是15672,而RabbitMQ-Server的访问端口是5672.而我在配置application.yml的时候配置的端口是5672,端口对照不上所以出现了连接超时的问题。

  解决办法就是把application.yml中的rabbitmq的端口号改为6572就行了。ps:如果这里你自定义了端口,就要按照自定义端口来。

  rabbitmq:
    host: 远程主机ip/域名
    port: 5672
    username: rabbitmq账号
    password: rabbitmq密码

 

posted on   飘杨......  阅读(755)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
· SQL Server 2025 AI相关能力初探
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示