[rabbitmq-discuss] publish msg in immediate mode and rabbitmq server's memory is pilling up

Matthias Radestock matthias at rabbitmq.com
Wed Nov 7 12:19:36 GMT 2012


On 07/11/12 11:56, 陈宇剑 wrote:
> i use rabbitmq to publish market quotations to our consumers.
> so i need the newest quotations but abandon the old ones.
> in my sititution, when  the service publishing msg  set immediate
> true,and   setting consumer  no_ack to false, and leave the message
> pre-fetch at 1,the consumer will get the newest market quotation and do
> something.

With the above setup, while the consumer is processing the message, all 
other messages are thrown away. So when the consumer finally acks that 
message there will be *no* other messages in the queue and it will have 
to wait until the next quotation arrives.

You may want to look at setting a pe-queue message ttl 
(http://www.rabbitmq.com/ttl.html#per-queue-message-ttl) of 0, as an 
alternative to 'immediate', though it will result in the same behaviour 
as above.

Or you could consider using 
https://github.com/simonmacmullen/rabbitmq-lvc-plugin, though it has 
it's own set of caveats.

> but when i configure this ,the rabbitmq itself's memory
> pilling up until i shutdown the publisher.

You didn't answer my question about what version of RabbitMQ you are 
running. 2.8.0 added internal flow control 
(http://www.rabbitmq.com/memory.html#per-connection) which should 
prevent this situation. So if you are running anything older then please 
upgrade.

Regards,

Matthias.



More information about the rabbitmq-discuss mailing list