当前位置:   article > 正文

已解决:ERROR com.rabbitmq.client.impl.ForgivingExceptionHandler - An unexpected connection driver error

error com.rabbitmq.client.impl.forgivingexceptionhandler - an unexpected con

ERROR com.rabbitmq.client.impl.ForgivingExceptionHandler - An unexpected connection driver error occurred java.net.SocketException: Socket Closed

java 连接Rabbitmq-server时报错

java.util.concurrent.TimeoutException
	at 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 Closed
	at 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)
  • 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

注意检查是不是端口设置错误了

端口应该是 5672 不是15672

		// 1. 创建连接工程
		ConnectionFactory connectionFactory = new ConnectionFactory();
		connectionFactory.setHost("121.89.219.240");
		connectionFactory.setPort(5672);
		connectionFactory.setVirtualHost("/");
		connectionFactory.setUsername("admin");
		connectionFactory.setPassword("admin");
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

Rabbitmq 相关端口

5672: 	RabbitMQ的通讯端口
25672:	RabbitMQ的节点间的CLI通讯端口是
15672:	RabbitMQ HTTP_API的端口,管理员用户才能访问,用于管理RabbitMQ,需要启动Management插件。
1883,8883:	MQTT插件启动时的端口。
61613、61614:	STOMP客户端插件启用的时候的端口。
15674、15675:	基于webscoket的STOMP端口和MOTT端口
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/628805
推荐阅读
相关标签
  

闽ICP备14008679号