RabbitMQ 3.8 Feature Focus - What is the RabbitMQ feature flag?

Feature flags are new to RabbitMQ version 3.8. These flags define a RabbitMQ node’s ability to become a part of a cluster. Nodes using the subsystem must have the same dependencies. This article reviews the new system, how to set flags, and how they are used in upgrades.

RabbitMQ feature flags

Feature flags are new to version 3.8. The mechanism controls which features are considered enabled or available on all cluster nodes. Flags allow for rolling upgrades. RabbitMQ allows nodes to communicate if and only if the feature sets match. This differs from previous iterations of the framework whose version numbers needed to match.

Why should I use feature flags?

Clusters process time-sensitive data. This makes constant availability crucial for your organization. Shutting down a server for upgrades is impossible when demand for your data is high.

New RabbitMQ features also add power to your backend. Discovering what is enabled gives you peace of mind when managing a large cluster. When the set of enabled features is equal, messages process in the same way. Upgrades allow your instance to stay active.

Which feature flags are available?

Users can generate feature flags as needed, but the most recent version of RabbitMQ contains three. These are:

  • empty_basic_get_metric: When enabled, basic.get issued on empty queues is shown in statistics.
  • implicit_default_bindings: When enabled, explicit default bindings are cleaned up implicitly.
  • quorum_queue: When enabled, quorum queue type is used.

Once set, you cannot disable a feature flag. All flags you enable locally must also be enabled on remote nodes. More information on the flags is available from the documentation.

Setting custom feature flags

When using an older version or needing to ensure that certain components match, a new flag allows for smooth upgrading and scaling:

‐rabbit_feature_flag{
  new_feature, #{desc => “Custom flag description”,
  desc_url => “url_to_documentation”,
  stability => stable,
  migration_fun {?MODULE, new_feature migration}
}})

Listing and enabling the feature flags from the command line

It is often necessary to gain an appreciation of which flags are set. The following commands list and enable feature flags:

rabbitmqctl list_feature_flags
rabbitmqctl enable_feature_flag flag_name

The first command returns a list of enabled features. The second enables a flag.

How can I find my RabbitMQ feature flags from the management console?

The RabbitMQ management console allows for flag management as well. Viewing and enabling flags is possible from the Admin section.

This section provides a description of each flag, name, and the current state. Clicking enable sets the related flag to active. The process is not reversible.

Fully managed RabbitMQ clusters from CloudAMQP

RabbitMQ feature flags force cluster peers to have the same version of software. Nodes must match before connecting. The new system allows different versions of the framework to interact.

Fully managed RabbitMQ clusters from CloudAMQP take the pain out of upgrading. Get in touch today for more information or explore new features using our free tier, Little Lemur.

CloudAMQP - industry leading RabbitMQ as a service

Start your managed cluster today. CloudAMQP is 100% free to try.

13,000+ users including these smart companies