Moleculer: Dead AMQP queues left behind

Created on 18 Dec 2019  路  7Comments  路  Source: moleculerjs/moleculer

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • [X] I am running the latest version
  • [X] I checked the documentation and found no answer
  • [X] I checked to make sure that this issue has not already been filed
  • [X] I'm reporting the issue to the correct repository

Current Behavior

After some time of operation, there are AMQP queues in the system which have:

  • no consumers
  • match the name pattering MOL.REQ.abcdef

The queues that caused me to investigate this issue had thousands of messages in them. Overall, there were hundreds of queues that no longer seemed to serve any purpose.

Expected Behavior

Queues that no longer serve a purpose are purged from the system automatically.

Failure Information

I checked the following issues for relation:

I have enabled autoDeleteQueues, but that doesn't seem to have any effect on the queues in question. After reading https://github.com/moleculerjs/moleculer/pull/341, I assumed this is by design.

Steps to Reproduce

Seems to require no specific interaction beyond starting/stopping processes.

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Moleculer version: 0.14-beta
  • NodeJS version: 12
  • Operating System: Amazon Linux
  • RabbitMQ: 3.8.0

Most helpful comment

@Nathan-Schwartz can you take a look at this?

All 7 comments

@Nathan-Schwartz can you take a look at this?

I initially observed this in our test environment and today looked into it locally. When I start up the current state of the application on a fresh install of RabbitMQ and then shut everything down moments later, I am left with several queues:

image

It is my understanding that some of these queues are to be expected to exist, but the EVENT, REQ and RES queues should be node-specific unless I'm mistaken. So these will just pile up over time.

This seems to have been a configuration error on my part. Instead of providing the transporter options, I provided option 馃槖

After _properly_ setting autoDeleteQueues, the queues in question are now also clearly marked as expiring.

image

I find it somewhat confusing that this feature isn't enabled by default. Is there any benefit to keeping these queues around? It seems to me like they are very hard to salvage and ultimately produce more clutter and load than what they're worth.

Ahh, sorry you had to deal with that.

It defaults to being disable for backwards compatibility reasons, but it could be changed. For more context you can check out the discussion on this topic midway through this thread.

@Nathan-Schwartz Yeah, I read that. But, given the note about breaking changes possibly happening all the time in the 0.x versions, I'd like to suggest maybe making that change. It can be frustrating when you're onboarding and then you have to clean up a lot of dead queues.

Works great now though. Cheers :)

If you @oliversalzburg & @Nathan-Schwartz confirm that we will change it. we could do that before stable 0.14, So open a PR with the changes in the next branch, if you think.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

icebob picture icebob  路  3Comments

slinkardbrandon picture slinkardbrandon  路  4Comments

nurdism picture nurdism  路  3Comments

jodaks picture jodaks  路  5Comments

ngraef picture ngraef  路  4Comments