本文主要是介绍已解决:ERROR com.rabbitmq.client.impl.ForgivingExceptionHandler - An unexpected connection driver error,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
ERROR com.rabbitmq.client.impl.ForgivingExceptionHandler - An unexpected connection driver error occurred java.net.SocketException: Socket Closed
java 连接Rabbitmq-server时报错
java.util.concurrent.TimeoutExceptionat com.rabbitmq.utility.BlockingCell.get(BlockingCell.java:77)at com.rabbitmq.utility.BlockingCell.uninterruptibleGet(BlockingCell.java:120)at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36)at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:502)at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:326)at com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnectionFactory.newConnection(RecoveryAwareAMQConnectionFactory.java:65)at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.init(AutorecoveringConnection.java:160)at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1216)at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1173)at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1310)at com.su.simple.Producer.main(Producer.java:30)
21:55:40.342 [AMQP Connection 121.89.219.240:15672] ERROR com.rabbitmq.client.impl.ForgivingExceptionHandler - An unexpected connection driver error occurred
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:665)at java.lang.Thread.run(Thread.java:748)
注意检查是不是端口设置错误了
端口应该是 5672 不是15672
// 1. 创建连接工程ConnectionFactory connectionFactory = new ConnectionFactory();connectionFactory.setHost("121.89.219.240");connectionFactory.setPort(5672);connectionFactory.setVirtualHost("/");connectionFactory.setUsername("admin");connectionFactory.setPassword("admin");
Rabbitmq 相关端口
5672: RabbitMQ的通讯端口
25672: RabbitMQ的节点间的CLI通讯端口是
15672: RabbitMQ HTTP_API的端口,管理员用户才能访问,用于管理RabbitMQ,需要启动Management插件。
1883,8883: MQTT插件启动时的端口。
61613、61614: STOMP客户端插件启用的时候的端口。
15674、15675: 基于webscoket的STOMP端口和MOTT端口
这篇关于已解决:ERROR com.rabbitmq.client.impl.ForgivingExceptionHandler - An unexpected connection driver error的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!