Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set max number of messages in the queue

I'm wondering is it possible to set the max number of messages in the queue?

Let's say I want to have no more than 100 msgs in queue Foo, is it possible to do?

like image 977
Vor Avatar asked Feb 15 '23 22:02

Vor


1 Answers

Yes, it is possible.

From official documentation

The maximum length of a queue can be limited to a set number of messages by supplying the x-max-length queue declaration argument with a non-negative integer value.

AFAIK, pika's channel.queue_declare has queue_declare has arguments argument which is definitely what you want.

like image 132
pinepain Avatar answered Feb 18 '23 14:02

pinepain