[rabbitmq-discuss] ACK modes in the STOMP adapter

Tony Garnock-Jones tonyg at lshift.net
Wed Jul 2 12:42:10 BST 2008


Hi Aman,

Aman Gupta wrote:
> Is there a way to handle flow control? I would like rabbitmq to stop 
> sending me new messages until I am done processing old ones, so that new 
> messages don't get lost.

At present, no, there's no explicit flow control mechanism.

One option might be to extend the STOMP adapter with an equivalent of 
AMQP's "basic.get" method, which retrieves a single message at a time 
from a queue, without using a subscription.

However, it's worth pointing out that messages are *not* lost if you 
choose "ack: client" mode. Instead, if the connection is dropped with 
unACKed messages outstanding on it, the unACKed messages are requeued 
and redelivered to the next consumer that comes along.

This redelivery behaviour, in conjunction with TCP's built-in window 
management, means that a crude form of flow control is simply to stop 
reading from the socket. When the buffers fill up at each end, the 
RabbitMQ server will notice, and will stop feeding the busy connection.

Regards,
   Tony
-- 
  [][][] Tony Garnock-Jones     | Mob: +44 (0)7905 974 211
    [][] LShift Ltd             | Tel: +44 (0)20 7729 7060
  []  [] http://www.lshift.net/ | Email: tonyg at lshift.net




More information about the rabbitmq-discuss mailing list