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密码
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库