-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Introduce deprecated features management #7390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is a work in progress, but here is what it could look like: First, you declare a deprecated feature: -rabbit_deprecated_feature(
{classic_mirrored_queues,
#{deprecation_phase => optout,
warning =>
"Classic mirrored queues are deprecated and will go away in RabbitMQ 4.x",
doc_url => "https://blog.rabbitmq.com/posts/2021/08/4.0-deprecation-announcements/"
}}). The deprecation phases would be:
Then in the code, we can verify if the feature is allowed to be used: %% Example with `rabbit_mirror_queue_misc:validate_policy/1
validate_policy(KeyList) ->
FeatureName = classic_mirrored_queues,
case rabbit_deprecated_features:is_permitted(FeatureName) of
false ->
Warning = rabbit_deprecated_features:get_warning(FeatureName),
{error, "~ts", [Warning]};
true ->
Mode = proplists:get_value(<<"ha-mode">>, KeyList, none),
Params = proplists:get_value(<<"ha-params">>, KeyList, none),
... Calling With this example, the warning is also returned as an error when someone tries to add an HA policy. For instance, in the management UI: |
79d96d6
to
0a976cc
Compare
ea400f1
to
177af61
Compare
177af61
to
fbe0161
Compare
cd386d5
to
76ed380
Compare
As an example, here is a branch where classic mirrored queues are deprecated: |
76ed380
to
953439f
Compare
9f2216e
to
5701cdb
Compare
1ebed0c
to
220fc9a
Compare
[Why] Global QoS, where a single shared prefetch is used for an entire channel, is not recommended practice. Per-consumer QoS (non-global) should be set instead. [How] The global QoS setting is marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.global_qos = false Global QoS can be turned off anytime, there are no conditions to do that. Once global QoS is turned off, the prefetch setting will always be considered as non-global (i.e. per-consumer). A warning message will be logged if the default prefetch setting enables global QoS or anytime a client requests a global QoS on the channel. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] RAM nodes provide no safety at all and they lost interest with recent fast storage solutions. [How] RAM nodes are marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See pull request #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.ram_node_type = false To turn off RAM nodes, there must be no RAM nodes in the cluster. Once RAM nodes are turned off, an existing node previously created as a RAM node will change itself to a disc node during boot. If a new node is added to the cluster using peer discovery or the CLI, it will be as a disc node and a warning will be logged if the requested node type is RAM. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] Classic queue mirroring will be removed in RabbitMQ 4.0. Quorum queues provide a better safer alternative. Non-replicated classic queues remain supported. [How] Classic queue mirroring is marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.classic_queue_mirroring = false To turn off classic queue mirroring, there must be no classic mirrored queues declared and no HA policy defined. Once classic queue mirroring is turned off, users will not be able to declare HA policies. Trying to do that from the CLI or the management API will be rejected with a warning in the logs. This impacts clustering too: a node with classic queue mirroring turned off will only cluster with another node which has no HA policy or has classic queue mirroring turned off. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process. V2: Renamed the deprecated feature from `classic_mirrored_queues` to `classic_queue_mirroring` to better reflect the intention. Otherwise it could be unclear is only the mirroring property is deprecated/removed or classic queues entirely.
[Why] Transient queues are queues that are removed upon node restart. An application developer can't rely on such an arbitrary event to reason about a queue's lifetime. The only exception are exclusive transient queues which have a lifetime linked to that of a client connection. [How] Non-exclusive transient queues are marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See pull request #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.transient_nonexcl_queues = false Non-exclusive transient queues can be turned off anytime, there are no conditions to do that. Once non-exclusive transient queues are turned off, declaring a new queue with those arguments will be rejected with a protocol error. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] Management metrics collection will be removed in RabbitMQ 4.0. The prometheus plugin provides a better and more scalable alternative. [How] The management metrics collection is marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See pull request #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.management_metrics_collection = false Management metrics collection can be turned off anytime, there are no conditions to do that. Once management metrics collection is turned off, the management API will not report any metrics and the UI will show empty graphs. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] Global QoS, where a single shared prefetch is used for an entire channel, is not recommended practice. Per-consumer QoS (non-global) should be set instead. [How] The global QoS setting is marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.global_qos = false Global QoS can be turned off anytime, there are no conditions to do that. Once global QoS is turned off, the prefetch setting will always be considered as non-global (i.e. per-consumer). A warning message will be logged if the default prefetch setting enables global QoS or anytime a client requests a global QoS on the channel. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] RAM nodes provide no safety at all and they lost interest with recent fast storage solutions. [How] RAM nodes are marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See pull request #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.ram_node_type = false To turn off RAM nodes, there must be no RAM nodes in the cluster. Once RAM nodes are turned off, an existing node previously created as a RAM node will change itself to a disc node during boot. If a new node is added to the cluster using peer discovery or the CLI, it will be as a disc node and a warning will be logged if the requested node type is RAM. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] Classic queue mirroring will be removed in RabbitMQ 4.0. Quorum queues provide a better safer alternative. Non-replicated classic queues remain supported. [How] Classic queue mirroring is marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.classic_queue_mirroring = false To turn off classic queue mirroring, there must be no classic mirrored queues declared and no HA policy defined. Once classic queue mirroring is turned off, users will not be able to declare HA policies. Trying to do that from the CLI or the management API will be rejected with a warning in the logs. This impacts clustering too: a node with classic queue mirroring turned off will only cluster with another node which has no HA policy or has classic queue mirroring turned off. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process. V2: Renamed the deprecated feature from `classic_mirrored_queues` to `classic_queue_mirroring` to better reflect the intention. Otherwise it could be unclear is only the mirroring property is deprecated/removed or classic queues entirely.
[Why] Transient queues are queues that are removed upon node restart. An application developer can't rely on such an arbitrary event to reason about a queue's lifetime. The only exception are exclusive transient queues which have a lifetime linked to that of a client connection. [How] Non-exclusive transient queues are marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See pull request #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.transient_nonexcl_queues = false Non-exclusive transient queues can be turned off anytime, there are no conditions to do that. Once non-exclusive transient queues are turned off, declaring a new queue with those arguments will be rejected with a protocol error. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] Management metrics collection will be removed in RabbitMQ 4.0. The prometheus plugin provides a better and more scalable alternative. [How] The management metrics collection is marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See pull request #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.management_metrics_collection = false Management metrics collection can be turned off anytime, there are no conditions to do that. Once management metrics collection is turned off, the management API will not report any metrics and the UI will show empty graphs. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] Global QoS, where a single shared prefetch is used for an entire channel, is not recommended practice. Per-consumer QoS (non-global) should be set instead. [How] The global QoS setting is marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.global_qos = false Global QoS can be turned off anytime, there are no conditions to do that. Once global QoS is turned off, the prefetch setting will always be considered as non-global (i.e. per-consumer). A warning message will be logged if the default prefetch setting enables global QoS or anytime a client requests a global QoS on the channel. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] RAM nodes provide no safety at all and they lost interest with recent fast storage solutions. [How] RAM nodes are marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See pull request #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.ram_node_type = false To turn off RAM nodes, there must be no RAM nodes in the cluster. Once RAM nodes are turned off, an existing node previously created as a RAM node will change itself to a disc node during boot. If a new node is added to the cluster using peer discovery or the CLI, it will be as a disc node and a warning will be logged if the requested node type is RAM. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] Classic queue mirroring will be removed in RabbitMQ 4.0. Quorum queues provide a better safer alternative. Non-replicated classic queues remain supported. [How] Classic queue mirroring is marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.classic_queue_mirroring = false To turn off classic queue mirroring, there must be no classic mirrored queues declared and no HA policy defined. Once classic queue mirroring is turned off, users will not be able to declare HA policies. Trying to do that from the CLI or the management API will be rejected with a warning in the logs. This impacts clustering too: a node with classic queue mirroring turned off will only cluster with another node which has no HA policy or has classic queue mirroring turned off. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process. V2: Renamed the deprecated feature from `classic_mirrored_queues` to `classic_queue_mirroring` to better reflect the intention. Otherwise it could be unclear is only the mirroring property is deprecated/removed or classic queues entirely.
[Why] Transient queues are queues that are removed upon node restart. An application developer can't rely on such an arbitrary event to reason about a queue's lifetime. The only exception are exclusive transient queues which have a lifetime linked to that of a client connection. [How] Non-exclusive transient queues are marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See pull request #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.transient_nonexcl_queues = false Non-exclusive transient queues can be turned off anytime, there are no conditions to do that. Once non-exclusive transient queues are turned off, declaring a new queue with those arguments will be rejected with a protocol error. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] Management metrics collection will be removed in RabbitMQ 4.0. The prometheus plugin provides a better and more scalable alternative. [How] The management metrics collection is marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See pull request #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.management_metrics_collection = false Management metrics collection can be turned off anytime, there are no conditions to do that. Once management metrics collection is turned off, the management API will not report any metrics and the UI will show empty graphs. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] Global QoS, where a single shared prefetch is used for an entire channel, is not recommended practice. Per-consumer QoS (non-global) should be set instead. [How] The global QoS setting is marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.global_qos = false Global QoS can be turned off anytime, there are no conditions to do that. Once global QoS is turned off, the prefetch setting will always be considered as non-global (i.e. per-consumer). A warning message will be logged if the default prefetch setting enables global QoS or anytime a client requests a global QoS on the channel. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] Global QoS, where a single shared prefetch is used for an entire channel, is not recommended practice. Per-consumer QoS (non-global) should be set instead. [How] The global QoS setting is marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.global_qos = false Global QoS can be turned off anytime, there are no conditions to do that. Once global QoS is turned off, the prefetch setting will always be considered as non-global (i.e. per-consumer). A warning message will be logged if the default prefetch setting enables global QoS or anytime a client requests a global QoS on the channel. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] RAM nodes provide no safety at all and they lost interest with recent fast storage solutions. [How] RAM nodes are marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See pull request #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.ram_node_type = false To turn off RAM nodes, there must be no RAM nodes in the cluster. Once RAM nodes are turned off, an existing node previously created as a RAM node will change itself to a disc node during boot. If a new node is added to the cluster using peer discovery or the CLI, it will be as a disc node and a warning will be logged if the requested node type is RAM. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] Classic queue mirroring will be removed in RabbitMQ 4.0. Quorum queues provide a better safer alternative. Non-replicated classic queues remain supported. [How] Classic queue mirroring is marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.classic_queue_mirroring = false To turn off classic queue mirroring, there must be no classic mirrored queues declared and no HA policy defined. Once classic queue mirroring is turned off, users will not be able to declare HA policies. Trying to do that from the CLI or the management API will be rejected with a warning in the logs. This impacts clustering too: a node with classic queue mirroring turned off will only cluster with another node which has no HA policy or has classic queue mirroring turned off. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process. V2: Renamed the deprecated feature from `classic_mirrored_queues` to `classic_queue_mirroring` to better reflect the intention. Otherwise it could be unclear is only the mirroring property is deprecated/removed or classic queues entirely.
[Why] Transient queues are queues that are removed upon node restart. An application developer can't rely on such an arbitrary event to reason about a queue's lifetime. The only exception are exclusive transient queues which have a lifetime linked to that of a client connection. [How] Non-exclusive transient queues are marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See pull request #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.transient_nonexcl_queues = false Non-exclusive transient queues can be turned off anytime, there are no conditions to do that. Once non-exclusive transient queues are turned off, declaring a new queue with those arguments will be rejected with a protocol error. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] RAM nodes provide no safety at all and they lost interest with recent fast storage solutions. [How] RAM nodes are marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See pull request #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.ram_node_type = false RAM nodes can be turned off anytime, there are no conditions to do that. Once RAM nodes are turned off, an existing node previously created as a RAM node will change itself to a disc node during boot. If a new node is added to the cluster using peer discovery or the CLI, it will be as a disc node and a warning will be logged if the requested node type is RAM. The `change_cluster_node_type` CLI command will reject a change to a RAM node with an error. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] Classic queue mirroring will be removed in RabbitMQ 4.0. Quorum queues provide a better safer alternative. Non-replicated classic queues remain supported. [How] Classic queue mirroring is marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.classic_queue_mirroring = false To turn off classic queue mirroring, there must be no classic mirrored queues declared and no HA policy defined. A node with classic mirrored queues will refuse to start if classic queue mirroring is turned off. Once classic queue mirroring is turned off, users will not be able to declare HA policies. Trying to do that from the CLI or the management API will be rejected with a warning in the logs. This impacts clustering too: a node with classic queue mirroring turned off will only cluster with another node which has no HA policy or has classic queue mirroring turned off. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process. V2: Renamed the deprecated feature from `classic_mirrored_queues` to `classic_queue_mirroring` to better reflect the intention. Otherwise it could be unclear is only the mirroring property is deprecated/removed or classic queues entirely.
[Why] Transient queues are queues that are removed upon node restart. An application developer can't rely on such an arbitrary event to reason about a queue's lifetime. The only exception are exclusive transient queues which have a lifetime linked to that of a client connection. [How] Non-exclusive transient queues are marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See pull request #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.transient_nonexcl_queues = false Non-exclusive transient queues can be turned off anytime, there are no conditions to do that. Once non-exclusive transient queues are turned off, declaring a new queue with those arguments will be rejected with a protocol error. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] Management metrics collection will be removed in RabbitMQ 4.0. The prometheus plugin provides a better and more scalable alternative. [How] The management metrics collection is marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See pull request #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.management_metrics_collection = false Management metrics collection can be turned off anytime, there are no conditions to do that. Once management metrics collection is turned off, the management API will not report any metrics and the UI will show empty graphs. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] Global QoS, where a single shared prefetch is used for an entire channel, is not recommended practice. Per-consumer QoS (non-global) should be set instead. [How] The global QoS setting is marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.global_qos = false Global QoS can be turned off anytime, there are no conditions to do that. Once global QoS is turned off, the prefetch setting will always be considered as non-global (i.e. per-consumer). A warning message will be logged if the default prefetch setting enables global QoS or anytime a client requests a global QoS on the channel. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] RAM nodes provide no safety at all and they lost interest with recent fast storage solutions. [How] RAM nodes are marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See pull request #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.ram_node_type = false RAM nodes can be turned off anytime, there are no conditions to do that. Once RAM nodes are turned off, an existing node previously created as a RAM node will change itself to a disc node during boot. If a new node is added to the cluster using peer discovery or the CLI, it will be as a disc node and a warning will be logged if the requested node type is RAM. The `change_cluster_node_type` CLI command will reject a change to a RAM node with an error. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
[Why] Classic queue mirroring will be removed in RabbitMQ 4.0. Quorum queues provide a better safer alternative. Non-replicated classic queues remain supported. [How] Classic queue mirroring is marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.classic_queue_mirroring = false To turn off classic queue mirroring, there must be no classic mirrored queues declared and no HA policy defined. A node with classic mirrored queues will refuse to start if classic queue mirroring is turned off. Once classic queue mirroring is turned off, users will not be able to declare HA policies. Trying to do that from the CLI or the management API will be rejected with a warning in the logs. This impacts clustering too: a node with classic queue mirroring turned off will only cluster with another node which has no HA policy or has classic queue mirroring turned off. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process. V2: Renamed the deprecated feature from `classic_mirrored_queues` to `classic_queue_mirroring` to better reflect the intention. Otherwise it could be unclear is only the mirroring property is deprecated/removed or classic queues entirely.
[Why] Transient queues are queues that are removed upon node restart. An application developer can't rely on such an arbitrary event to reason about a queue's lifetime. The only exception are exclusive transient queues which have a lifetime linked to that of a client connection. [How] Non-exclusive transient queues are marked as deprecated in the code using the Deprecated features subsystem (based on feature flags). See pull request #7390 for a description of that subsystem. To test RabbitMQ behavior as if the feature was removed, the following configuration setting can be used: deprecated_features.permit.transient_nonexcl_queues = false Non-exclusive transient queues can be turned off anytime, there are no conditions to do that. Once non-exclusive transient queues are turned off, declaring a new queue with those arguments will be rejected with a protocol error. Note that given the marketing calendar, the deprecated feature will go directly from "permitted by default" to "removed" in RabbitMQ 4.0. It won't go through the gradual deprecation process.
This introduces a way to declare deprecated features in the code, not only in our communication. The new module allows to disallow the use of a deprecated feature and/or warn the user when he relies on such a feature.
Why
Currently, we only tell people about deprecated features through blog posts and the mailing-list. This might be insufficiant for our users that a feature they use will be removed in a future version:
The idea behind this patch is to increase the chance that users notice that they are using something which is about to be dropped from RabbitMQ. Anopther benefit is that they should be able to test how RabbitMQ will behave in the future before the actual removal. This should allow them to test and plan changes.
How
When a feature is deprecated in other large projects (such as FreeBSD where I took the idea from), it goes through a lifecycle:
The solution in this patch offers the same lifecycle. A deprecated feature will be in one of these deprecation phases:
permitted_by_default
: The feature is available. Users get a warning if they use it. They can disable it from the configuration.denied_by_default
: The feature is available but disabled by default. Users get an error if they use it and RabbitMQ behaves like the feature is removed. They can re-enable is from the configuration and get a warning.disconnected
: The feature is present in the source code, but is disabled and can't be re-enabled without recompiling RabbitMQ. Users get the same behavior as if the code was removed.removed
: The feature's code is gone.The whole thing is based on the feature flags subsystem, but it has the following differences with other feature flags:
permitted_by_default
and the configuration denies the deprecated featuredenied_by_default
and the configuration doesn't permit the deprecated featuredisconnected
orremoved
Otherwise, deprecated features' feature flags are managed like other feature flags, in particular inside clusters.
To declare a deprecated feature:
Then, to check the state of a deprecated feature in the code:
Warnings and errors are logged automatically. A message is generated automatically, but it is possible to define a message in the deprecated feature flag declaration like in the example above.
Here is an example of a logged warning that was generated automatically:
To override the default state of
permitted_by_default
anddenied_by_default
deprecation phases, users can set the following configuration:The actual behavior protected by a deprecated feature check is out of scope for this subsystem. It is the repsonsibility of each deprecated feature code to determine what to do when the deprecated feature is denied.