stefku
stefku

Reputation: 117

Force RabbitMQ stop receiving any messages

How can we force RabbitMQ to stop receiving any messages for a certain time?

It must be fast as possible since we want to do that between tests.

We tried policies, but haven't found any that work for that question. Also rabbitmqctl stop and start would work but this is quite slow.

Background: We have an automated end to end test environment with RabbitMQ and lots of services. Between tests, we want to reset the environment with clearing all stores and caches and also the queues. Problem is, that in an intermediate state messages can populate data in an already cleared service. So we want to first stop RabbitMQ receiving messages, then clear all queues, then clear all stores and caches on all services.

Upvotes: 1

Views: 939

Answers (1)

Florian Seidl
Florian Seidl

Reputation: 36

I set the policy

max-length-bytes:   1
overflow:   reject-publish

for all Queues and Exchanges. That seemes to work, rabbit mq does not delivery any more messages.

Upvotes: 2

Related Questions