1:首先说明这只是rabbitMq链接报错的原因之一
- 错误原因:结合下面这张图进行说明吧,rabbitMq服务有两个端口,一个是用户服务链接的,一个是用于web页面查看信息用的,我们平时项目链接的话,用的就是服务链接的端口,如下图:服务链接就用55672端口;web查看信息就用15672.
- 我下面这个错就是用错端口了,用web端口15672去链接服务,一定是链接不上的。
09-23 10:52:47.892 ERROR [com.rabbitmq.client.impl.ForgivingExceptionHandler] - An unexpected connection driver error occured
java.net.SocketException: Socket Closedat java.net.SocketInputStream.socketRead0(Native Method)at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)at java.net.SocketInputStream.read(SocketInputStream.java:171)at java.net.SocketInputStream.read(SocketInputStream.java:141)at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)at java.io.BufferedInputStream.read(BufferedInputStream.java:265)at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:288)at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:91)at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:184)at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:598)at java.lang.Thread.run(Thread.java:748)
09-23 10:52:47.893 WARN [o.s.boot.actuate.amqp.RabbitHealthIndicator] - Rabbit health check failed
org.springframework.amqp.AmqpTimeoutException: java.util.concurrent.TimeoutException
2:找了好久看了这篇文档才茅塞顿开
https://www.jianshu.com/p/66551708ad15