Skip to content

Change default value for Durable flag on Queue creation for pidbox (RabbitMQ deprecated feature transient_nonexcl_queues) #2237

@Osmoskour

Description

@Osmoskour

In 4.0, RabbitMQ added transient_nonexcl_queues to deprecated features:
https://www.rabbitmq.com/release-information/deprecated-features-list
https://www.rabbitmq.com/blog/2021/08/21/4.0-deprecation-announcements#removal-of-transient-non-exclusive-queues

rabbitmq  | 2025-01-27 09:40:55.277393+00:00 [warning] <0.780.0> Deprecated features: `transient_nonexcl_queues`: Feature `transient_nonexcl_queues` is deprecated.
rabbitmq  | 2025-01-27 09:40:55.277393+00:00 [warning] <0.780.0> By default, this feature can still be used for now.
rabbitmq  | 2025-01-27 09:40:55.277393+00:00 [warning] <0.780.0> Its use will not be permitted by default in a future minor RabbitMQ version and the feature will be removed from a future major RabbitMQ version; actual versions to be determined.

By default, the durable flag for new queue is False. This is hardcoded for pidbox.py:

kombu/kombu/pidbox.py

Lines 395 to 405 in a0175b0

def _get_exchange(self, namespace, type):
return Exchange(self.exchange_fmt % namespace,
type=type,
durable=False,
delivery_mode='transient')
def _get_reply_exchange(self, namespace):
return Exchange(self.reply_exchange_fmt % namespace,
type='direct',
durable=False,
delivery_mode='transient')

kombu/kombu/pidbox.py

Lines 233 to 257 in a0175b0

def get_reply_queue(self):
oid = self.oid
return Queue(
f'{oid}.{self.reply_exchange.name}',
exchange=self.reply_exchange,
routing_key=oid,
durable=False,
auto_delete=True,
expires=self.reply_queue_expires,
message_ttl=self.reply_queue_ttl,
)
@cached_property
def reply_queue(self):
return self.get_reply_queue()
def get_queue(self, hostname):
return Queue(
f'{hostname}.{self.namespace}.pidbox',
exchange=self.exchange,
durable=False,
auto_delete=True,
expires=self.queue_expires,
message_ttl=self.queue_ttl,
)

kombu/kombu/pidbox.py

Lines 272 to 274 in a0175b0

exchange = Exchange(exchange, exchange_type='direct',
delivery_mode='transient',
durable=False)

And not hardcoded for qpid.py but setting it to True can be a sensible default:

def queue_declare(self, queue, passive=False, durable=False,

def exchange_declare(self, exchange='', type='direct', durable=False,

By setting those to True, can we avoid the deprecated feature warning?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions