Skip to content

Conversation

@orlandothoeny
Copy link

@orlandothoeny orlandothoeny commented Dec 2, 2025

Adds an --skip-anon-consumers option to the SetupFabricCommand (rabbitmq:setup-fabric).
Which will skip the setupFabric() method call on AnonConsumers if the option is set. The behaviour is the same as now if the option is not set.

Our use case:

We have producer and consumer containers.
These run the rabbitmq:setup-fabric command on startup.
We have set the auto_setup_fabric config to false on our producers & consumers.

This way, we can ensure that all needed exchanges & queues exist after the container has started. And the exchanges & queues are not redeclared every time we publish a message or restart a consumer.

Problem we run into:

We also have anonymous consumers. For those, we observe that the anonymous / auto-delete queues that are created by the rabbitmq:setup-fabric command are never deleted.
This may be the case, because we use the same RabbitMQ bundle configuration for our producer & consumer containers (we'd like to keep it that way if possible, makes it easier). Thus, the anon consumers are also configured on the producer containers. And those create a new auto-delete queue when they run the rabbitmq:setup-fabric command. I'm not 100% sure, but I suspect these queues are never deleted, because there's never a consumer for them.

The easiest fix I see is, to just add the ability to ignore the anon consumers when running the command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant