[rabbitmq-discuss] flow control and erlang client(s)

Matthias Radestock matthias at lshift.net
Wed Jun 24 03:07:58 BST 2009


Mark Geib wrote:
> I have seen in the erlang client test code that #'channel.flow'{active = 
> false} is supported for flow control related to memory high/low water 
> marks. However I need to limit the number of message published to a 
> queue on a broker and need to know if in 1.6 it is supported and if so 
> how to create the queue for support flow control, that is stopping 
> message publishing until message are dequeued...

What you are asking for is actually conceptually impossible.

In AMQP producers publish messages to an *exchange* (note that they are 
not "connected" to that exchange; each publish command can potentially 
go to a different exchange), which then routes them to *zero or more* 
queues, depending on the type of exchange, routing key in the message, 
and existing bindings between queues and the exchange.

So there is no way for the broker to know which of its connected clients 
might next send a message that ends up getting routed to a particular 
queue. Hence it cannot throttle clients based on any queue-based limits.

If there were per-queue message count limits (and this is something 
which has been discussed, though it's not part of the AMQP spec and not 
something RabbitMQ currently implements), the best the broker could do 
is reject, return or discard any messages that arrive after the limit 
has been reached.



More information about the rabbitmq-discuss mailing list