我正在使用 RabbitMQ 客户端 5.2.0。
我正在从事的项目的要求如下:
生产者发布大量数据
可扩展的消费者和队列数量。每个启动的消费者都会声明自己的队列并订阅它们
当一个消费者 N 关闭时,其他消费者必须捕捉到 QueueN 不再有消费者,因此他们必须解除绑定然后删除它。
所以基本上每个消费者每次都会执行以下操作:
uint count = _redisclient.ConsumerCount(queueName);
if (count < 1)
{
_redisclient.QueueUnbind(queueName);
}
每次执行最后一次操作时,我都会收到以下异常:
2021-09-14 19:29:22 [Error] Error while checking the queue: MT-SB-LP-007__LiveOddsChange_ConsistentHash_Inst_1_Process_4. Trying again on the next loop. Exception: Already closed: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=404, text='NOT_FOUND - no queue 'iis-sb-dev-3__LiveOddsChange_ConsistentHash_Inst_2_Process_8' in vhost '/'', classId=50, methodId=10 at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
之后通道处于故障状态,我无法获得有关队列和消费者的任何进一步信息。
我究竟做错了什么?