protocol method: #method(reply-code=406, reply-text=PRECONDITION_FAILED - unknown del

Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; reason: {#method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - unknown delivery tag 18 - 後面的忘了

INFO | jvm 1 | 2017/02/23 14:28:43 | at java.lang.Thread.run(Thread.java:745)
INFO | jvm 1 | 2017/02/23 14:28:43 | Exception in thread "LDService-Worker-3" com.rabbitmq.client.AlreadyClosedException: channel is already closed due to channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - unknown delivery tag 2, class-id=60, method-id=80)
INFO | jvm 1 | 2017/02/23 14:28:43 | at com.rabbitmq.client.impl.AMQChannel.ensureIsOpen(AMQChannel.java:195)
INFO | jvm 1 | 2017/02/23 14:28:43 | at com.rabbitmq.client.impl.AMQChannel.transmit(AMQChannel.java:309)
INFO | jvm 1 | 2017/02/23 14:28:43 | at com.rabbitmq.client.impl.ChannelN.basicPublish(ChannelN.java:657)
INFO | jvm 1 | 2017/02/23 14:28:43 | at com.rabbitmq.client.impl.ChannelN.basicPublish(ChannelN.java:640)
INFO | jvm 1 | 2017/02/23 14:28:43 | at com.rabbitmq.client.impl.ChannelN.basicPublish(ChannelN.java:631)
INFO | jvm 1 | 2017/02/23 14:28:43 | at com.rabbitmq.client.impl.recovery.AutorecoveringChannel.basicPublish(AutorecoveringChannel.java:168)
INFO | jvm 1 | 2017/02/23 14:28:43 | at com.ld.net.remoting.rmq.XXX$DealRequest.processRequest(XXX.java:567)
INFO | jvm 1 | 2017/02/23 14:28:43 | at com.ld.net.remoting.rmq.XXX$3$1.run(XXX.java:208)
INFO | jvm 1 | 2017/02/23 14:28:43 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
INFO | jvm 1 | 2017/02/23 14:28:43 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)java

緣由:經屢次重複測試,應該是客戶端double ack的緣由。jvm

若是啓用了批量ack的,將channel.basicAck(envelope.getDeliveryTag(), true); 改成channel.basicAck(envelope.getDeliveryTag(), false);測試

不然,檢查下是否在basicConsume的時候設置了autoAck,同時業務代碼裏面又調用了channel.basicAck。spa

除此以外,還可能有下列錯誤:.net

com.rabbitmq.client.ShutdownSignalException: clean channel shutdown; protocol method: #method<channel.close>(reply-code=200, reply-text=OK, class-id=0, method-id=0)線程

INFO | jvm 1 | 2017/02/24 10:28:59 | 17-02-24 10:28:58 ERROR CF-TP-37  XXX$3.handleDelivery(XXX.java:226): 處理消息的時候發生異常,會致使channel關閉,須要重啓
INFO | jvm 1 | 2017/02/24 10:28:59 | java.util.concurrent.RejectedExecutionException: Task XXXX.$3$1@722bfd74 rejected from java.util.concurrent.ThreadPoolExecutor@33b8fcd1[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 476]
INFO | jvm 1 | 2017/02/24 10:28:59 | at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2047)
INFO | jvm 1 | 2017/02/24 10:28:59 | at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823)
INFO | jvm 1 | 2017/02/24 10:28:59 | at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1369)
INFO | jvm 1 | 2017/02/24 10:28:59 | at XXX.$3.handleDelivery(LDMultiServiceBeanConfigurer.java:205)
INFO | jvm 1 | 2017/02/24 10:28:59 | at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:144)
INFO | jvm 1 | 2017/02/24 10:28:59 | at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:99)
INFO | jvm 1 | 2017/02/24 10:28:59 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
INFO | jvm 1 | 2017/02/24 10:28:59 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
INFO | jvm 1 | 2017/02/24 10:28:59 | at java.lang.Thread.run(Thread.java:745)日誌

這不必定是MQ自身的問題,有多是客戶端有其餘的非MQ相關的異常沒有被捕獲致使線程拋出異常,進而致使相關MQ消費者線程也異常,詳細看日誌。code

相關文章
相關標籤/搜索