SimpleMessageListenerContainer - 消费者引发异常,如果连接工厂支持,则处理可以重新启动

时间:2016-02-28 06:26:12

标签: java rabbitmq spring-rabbitmq

我在春天的兔子消费者方面一直收到以下警告。它一直在寻找重启。

[SimpleAsyncTaskExecutor-3317] WARN  org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer - Consumer raised exception, processing can restart if the connection factory supports it
    com.rabbitmq.client.ShutdownSignalException: connection error
            at com.rabbitmq.client.impl.AMQConnection.startShutdown(AMQConnection.java:715)
            at com.rabbitmq.client.impl.AMQConnection.shutdown(AMQConnection.java:705)
            at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:567)
            at java.lang.Thread.run(Thread.java:745)
    Caused by: java.net.SocketException: Connection reset
            at java.net.SocketInputStream.read(SocketInputStream.java:189)
            at java.net.SocketInputStream.read(SocketInputStream.java:121)
            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:95)
            at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:139)
            at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:532)
            ... 1 more

并且

[SimpleAsyncTaskExecutor-3316] INFO  org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer - Restarting Consumer: tags=[[amq.ctag-0o_AANjD6-IsH8H3MGWNnQ]], channel=Cached Rabbit Channel: AMQChannel, acknowledgeMode=AUTO local queue size=0
2016-02-28 06:06:58,634 334085996 [SimpleAsyncTaskExecutor-3317] INFO  org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer - Restarting Consumer: tags=[[amq.ctag-RXsch0v9cjuRlEB-ck1Lvg]], channel=Cached Rabbit Channel: AMQChannel, acknowledgeMode=AUTO local queue size=0
2016-02-28 06:06:58,651 334086013 [SimpleAsyncTaskExecutor-3318] WARN  org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer - Consumer raised exception, processing can restart if the connection factory supports it
com.rabbitmq.client.ShutdownSignalException: connection error

2 个答案:

答案 0 :(得分:0)

如果您看到以下例外

java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:189) at java.net.SocketInputStream.read(SocketInputStream.java:121) 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:95) at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:139) at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:532)

这意味着您正在关闭消费者,而不是停止消费者。

答案 1 :(得分:0)

查看服务器日志 - 由于某种原因服务器强制关闭(重置)连接。