[英]rabbitmq connection recovery issue in spring cloud stream
I am new to spring
, I am using a rabbitmq
which is in the spring-cloud-stream
. 我是
spring
的rabbitmq
,我正在使用spring-cloud-stream
中的rabbitmq
。 Here I am using version of rabbitmq
4.0.7
. 在这里,我使用的是
rabbitmq
4.0.7
版本。 Version of spring-AMQP
1.7
. spring-AMQP
1.7
。 I checked all the things, but I am not able to resolve the issue. 我检查了所有内容,但无法解决问题。 So, the error is
所以,错误是
Caught an exception during connection recovery!
java.io.IOException
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:106)
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:102)
at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:350)
at com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnectionFactory.newConnection(RecoveryAwareAMQConnectionFactory.java:36)
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.recoverConnection(AutorecoveringConnection.java:476)
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.beginAutomaticRecovery(AutorecoveringConnection.java:444)
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.access$000(AutorecoveringConnection.java:53)
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection$1.shutdownCompleted(AutorecoveringConnection.java:383)
at com.rabbitmq.client.impl.ShutdownNotifierComponent.notifyListeners(ShutdownNotifierComponent.java:75)
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:578)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.rabbitmq.client.ShutdownSignalException: connection error
at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:67)
at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:37)
at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:367)
at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:293)
... 8 more
Caused by: java.io.EOFException
at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290)
at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:95)
at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:139)
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:538)
... 1 more
Channel channel = (Channel)message.getHeaders().get(AmqpHeaders.CHANNEL);
This way I am creating the channel, I have a application.yml
file where I set all the binding properties. 这样,我创建通道时,就有了
application.yml
文件,在其中设置了所有绑定属性。 Can any tell me the reason about this ? 有人能告诉我原因吗?
1.7.1 disables auto recovery by default (unless you inject a preconfigured Rabbit ConnectionFactory
into the CachingConnectionFactory
). 1.7.1默认情况下禁用自动恢复(除非您将预先配置的Rabbit
ConnectionFactory
注入CachingConnectionFactory
)。
It was incorrectly enabled by default in 1.7.0. 默认情况下在1.7.0中未正确启用它。
Spring AMQP doesn't need autorecovery, it has had its own connection recovery mechanisms since 1.0. Spring AMQP不需要自动恢复,它从1.0开始就有自己的连接恢复机制。
The current 1.7.x version is 1.7.6; 当前的1.7.x版本是1.7.6; the current (preferred) version is 2.0.2.
当前(首选)版本是2.0.2。
This doesn't explain the EOFException (auto recovery still, normally, works - it's just not needed). 这并不能解释EOFException(自动恢复通常仍然有效,只是不需要)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.