Upgrading Queue Size(x-max-length)of an existing queue

938 views
Skip to first unread message

Ash M

unread,
May 30, 2018, 12:16:54 AM5/30/18
to rabbitmq-users
Hi,

RabbitMq Version is :  "RabbitMQ","3.6.6"
I am trying to upgrade the size of the queue , from x-max-length  : 2 to from x-max-length  : 7. When I try to set the x-max-length property using the following command

 rabbitmqctl set_policy ash-pol "^test-ash-q$" '{"x-max-length":7}' --apply-to queues 

I get the following error : 
Error: Validation failed
[{<<"x-max-length">>,7}] are not recognised policy settings

Question : x-max-length is a queue declaration argument, Can I update it after the queue is created?
Question : What  is the right approach to update the queue size? 

Thanks.

anup anand

unread,
May 30, 2018, 12:46:55 AM5/30/18
to rabbitm...@googlegroups.com
The equivalent property for policy is 'max-length'.

Thanks
Anup

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ash M

unread,
May 30, 2018, 1:04:30 AM5/30/18
to rabbitmq-users
Thanks for answering. But this property does not have any effect. 
for example if my x-max-length while declaring the queue  is 2 and i set a policy with max-length - 7 with priority 1. It still takes only 2 message and queue lenght does not increase.

anup anand

unread,
May 30, 2018, 1:16:32 AM5/30/18
to rabbitm...@googlegroups.com
You will be able to change queue properties only if they are implemented using policy. Try creating queue without x-max-length property. Add a policy to enforce max-length =2. Update policy to change max-length =7.

Thanks
Anup

Ash M

unread,
May 30, 2018, 1:38:41 AM5/30/18
to rabbitmq-users
Thanks Anup, I was trying to avoid delete queue. Looks like I will have to delete the queue. Thanks Again!

Ash M

unread,
Jun 1, 2018, 3:23:29 AM6/1/18
to rabbitmq-users
Is there a command to check size of the queue?

Arnaud Cogoluègnes

unread,
Jun 1, 2018, 3:52:54 AM6/1/18
to rabbitm...@googlegroups.com
Please start a new thread for a new question.

There are several queue endpoints in tje HTTP API, they all contain information about queues, including number of messages.

If you use an AMQP client, the queue.declare method accepts a passive flag to check the existence of queue, the declare-ok response contains the number of messages in the queue. Clients usually provide an explicit queueDeclarePassive function that set the passive flag to true.
 

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

sasikala tholisam

unread,
Jun 18, 2019, 2:04:28 AM6/18/19
to rabbitmq-users
I want to create queue with x-max-length-bytes=int64(1000000000)
at the time of declaration of queue in golang..could you help me?

Michael Klishin

unread,
Jun 30, 2019, 6:42:57 PM6/30/19
to rabbitmq-users
Use a policy and please do not post new questions to existing threads.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
MK

Staff Software Engineer, Pivotal/RabbitMQ
Reply all
Reply to author
Forward
0 new messages