[RFE] Have more granular control for topic exchanges and durable mode
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.messaging |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Hello,
## Context
RabbitMQ, AMQP
## Problem description
Today, each service can declare their own control exchange [1], but if this one is not defined in the service config the service will use the default value (`openstack`)[1]. If more than 2 services do not defined their own control exchange this default exchange will be implicitly turned as a shared control exchanges.
Today, each service can declare if their queues are durable queues or not [2] (by default they aren't durable queues). The service will try to configure each create queue with this config (durable or not).
The problem is that when a control exchange become a shared control exchange, de facto when more than two services use the same control exchange name, if one service is not configured to set durable queues (name it the service A) and if the other service is set to create durable queues (name it the service B), then when the service A will create the shared control exchange, it will create it as a control exchange with non durable queue, in turn then the service B will try to declare the shared control exchange, however, this control exchange already exist and it is already configured, then rabbitmq will reject the configuration given by B because the exchange already exist and the given configuration isn't compatible with the one given by A.
The problem described in the previous sentence will lead to an error. B will get a PRECONDITION_FAILED error related to the configuration of durable queues [3].
## Work around
If all the services set their own control exchanges [1], then they are able to also set specific durable queues for these dedicated control exchanges. The trick here is to not use the default control exchange to allow to configure if queues are durable or not.
Else, if services with different configurations try to apply them to the same control exchange (a shared control exchange) when this will lead to this issue (see the side observations section below).
## Enhancement
It could be worth to see if is it possible to give more granular control for topic exchanges and for durable mode to allow users to be more fine grained in their configuration and avoiding similar issues. In other words, this kind of improvement could lead to more isolated configurations and applied on topic consumption for services.
The problem described here is more a design issue at the services/
I need to dig more to see how to get around this problem by using rabbitmq's capabilities and features.
## Side observations
I think the same problem exist with the `auto_delete` configuration of these implicitly shared control exchanges, and if two services set different values concerning how to auto delete queues of a shared control exchange then the same kind of `PRECONDITION_
[1] https:/
[2] https:/
[3] ```
2021-12-02 12:13:56.689 13 ERROR oslo.messaging.
```
Please note that changing defaults for control exchange of a service would likely provide an upgrade impact. Updating defaults should happen consistently, otherwise two sides of RPC wouldn't be able to communicate, until restarted with a new config. Also, it might affect custom ha-policies set by operators for rabbitmq, expecting 'openstack' instead of the changed defaults.
Meanwhile, the status quo remains as that - one *cannot* use amqp durable queues with today control_exchange defaults.