当前位置:   article > 正文

Channel shutdown: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=_channel error; protocol method: #method

channel error; protocol method: #method(reply-code=406, reply

RabbitMq重复签收问题

Channel shutdown: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - unknown delivery tag 1, class-id=60, method-id=80)
  • 1
  • 在配置文件中配置了手动签收
spring:
  rabbitmq:
    host: 000
    port: 5672
    username: 000
    password: 000
    virtual-host: /000
    publisher-returns: true
    listener:
      simple:
        acknowledge-mode: manual # 手动应答
        prefetch: 1 #每次从队列中取一个,轮询分发,默认是公平分发
        retry:
          max-attempts: 5 # 重试次数
          enabled: true # 开启重试
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 消费者处理
try{
	...这里一堆逻辑...

	// 处理完之后手动签收
	channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
} catch (Exception e) {
   log.error("【传播渠道记录1】 接收到消息为:" + skuIdStr + " ,消息异常消费 : ", e);
} finally {
    // 处理完之后手动签收(这里再次签收)
    channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

消费者内部重复签收导致签收异常。。。。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/639281
推荐阅读
相关标签
  

闽ICP备14008679号