Cássio
Cássio

Reputation: 649

RabbitMQ delivery throttle

So I'm testing RabbitMQ in one node. Plain and simple,

Currently consumers execute thousands of messages per second, they are too fast so I need them to slow down. Managing consumer-side throttling is not possible due to network unreliable nature.

Collectively consumers must not take more than 10 messages per second altogether from that queue.

Is there a way to configure RabbitMQ so as the queue dispatches a maximum of 10 messages per second?

Upvotes: 0

Views: 1441

Answers (1)

Mark Bramnik
Mark Bramnik

Reputation: 42431

If I remember correctly, once Rabbit MQ has delivered a message to the queue, it's up to consumers to consume a message. There are various consumers in different languages, you haven't mentioned anything specific, so I'm giving a generic answer.

In my understanding, you shouldn't try to impose any restrictions on Rabbit MQ itself, instead, consider implementing connection pool of message consumers that will be able to handle not more than X messages simultaneously on the client side. Alternatively, you can provide some kind of semaphore at the handler itself, but not on the Rabbit MQ server itself.

Upvotes: 1

Related Questions