diff --git a/oslo_messaging/_drivers/impl_rabbit.py b/oslo_messaging/_drivers/impl_rabbit.py index 205758f2b..70fb5427b 100644 --- a/oslo_messaging/_drivers/impl_rabbit.py +++ b/oslo_messaging/_drivers/impl_rabbit.py @@ -195,12 +195,16 @@ rabbit_opts = [ 'Used only when rabbit_quorum_queue is enabled, ' 'Default 0 which means dont set a limit.'), cfg.IntOpt('rabbit_transient_queues_ttl', - min=1, + min=0, default=1800, help='Positive integer representing duration in seconds for ' 'queue TTL (x-expires). Queues which are unused for the ' 'duration of the TTL are automatically deleted. The ' - 'parameter affects only reply and fanout queues.'), + 'parameter affects only reply and fanout queues. Setting ' + '0 as value will disable the x-expires. If doing so, ' + 'make sure you have a rabbitmq policy to delete the ' + 'queues or you deployment will create an infinite number ' + 'of queue over time.'), cfg.IntOpt('rabbit_qos_prefetch_count', default=0, help='Specifies the number of messages to prefetch. Setting to ' diff --git a/releasenotes/notes/allow-transient-no-expire-ce7ae9d8c9d15751.yaml b/releasenotes/notes/allow-transient-no-expire-ce7ae9d8c9d15751.yaml new file mode 100644 index 000000000..3973ec452 --- /dev/null +++ b/releasenotes/notes/allow-transient-no-expire-ce7ae9d8c9d15751.yaml @@ -0,0 +1,11 @@ +--- +features: + - | + Allow creation of transient queues with no expire. + When an operator rely on rabbitmq policies, there is no point to set the + queue TTL in config. + When the rabbit_transient_queues_ttl is set to 0, no x-expire parameter + will be set on queue declaration. + In that specific situation, it is recommended to set an expire value using + rabbitmq policies. + See https://www.rabbitmq.com/parameters.html#policies