在有限的请求尝试后从 rabbit MQ 中删除消息

Remove message from rabbit MQ after limited attempts of requeing

我将文件中的记录放入 rabbit mq,从队列中读取记录并调用 service.For 拒绝的记录,我正在发送否定确认并根据 channel.basicNack method.But 要求重新排队是我们只需要进行大约 3 次服务尝试 call.After 我们必须从队列中删除消息而不是继续一次又一次地调用服务。

在最后一次尝试中,将 basicNack 中的 requeue 参数设置为 false。