nestjs icon indicating copy to clipboard operation
nestjs copied to clipboard

rabbitmq: canceled consumers are resumed if connection/channel reconnects

Open ttshivers opened this issue 1 year ago • 2 comments

An explicitly canceled consumer through cancelConsumer is reapplied on connection reconnection since the setup method is ran again which registers the subscribers again.

ttshivers avatar Apr 16 '24 20:04 ttshivers

I think we might want to register and cancel the consumers with amqp-connection-manager's ChannelWrapper methods consume and cancel https://github.com/jwalton/node-amqp-connection-manager/blob/599d31f01d2e13d6a049bd7645e39e5de99d0293/src/ChannelWrapper.ts#L721 once outside of the setup which is run on every reconnect.

ttshivers avatar Apr 16 '24 20:04 ttshivers