5

i would like to set the "x-message-ttl" of an existing queue, but the said it's not possible:

Important The RabbitMQ broker will not allow declaration of a queue with mismatched arguments. For example, if a queue already exists with no time to live argument, and you attempt to declare it with, say, key="x-message-ttl" value="100", an exception will be thrown.

By default, the RabbitAdmin will immediately stop processing all declarations when any exception occurs; this could cause downstream issues - such as a listener container failing to initialize because another queue (defined after the one in error) is not declared.

This behavior can be modified by setting the ignore-declaration-failures attribute to true on the RabbitAdmin. This option instructs the RabbitAdmin to log the exception, and continue declaring other elements.

http://docs.spring.io/spring-amqp/docs/1.3.9.RELEASE/reference/html/amqp.html#broker-configuration

What is the reason, that the RabbitAdmin don't support this feature? Via the Rabbit UI or CLI it's is possible to change the arguments of an existing queue, or?

Is there a workaround to change the arguments of an existing queue?

Thanks!

Dennis

MelleD
  • 657
  • 1
  • 9
  • 23

1 Answers1

13

RabbitMQ does not allow such changes.

From the rabbit team:

Is it possible to change arguments on an existing queue without deleting and recreating it?

No.

Community
  • 1
  • 1
Gary Russell
  • 166,535
  • 14
  • 146
  • 179
  • 3
    Oh God, now guys think seriously about how much time you want to retry a queue before put it in dead letter queue because then is impossible change it without drastic actions. Not makes sense for me – deFreitas Oct 07 '16 at 12:09
  • "RabbitMQ doesn't allow you to redefine an existing queue with different parameters and will return an error to any program that tries to do that. But there is a quick workaround - declare a queue with different name." Source: https://www.rabbitmq.com/tutorials/tutorial-two-python.html – jkovba May 22 '19 at 12:49