Skip to main content
Version: Early Access

Manual Upgrade RabbitMQ

This guide explains how to manually upgrade RabbitMQ.

Starting with Operator version 25.1 or later, RabbitMQ 4.x is used by default with quorum queues. If you're upgrading from an earlier Operator version (for example, 23.x) that used RabbitMQ 3.x with mirrored queues, you must perform a manual migration.

RabbitMQ server versions are not automatically upgraded during operator-to-operator or Helm-to-operator upgrades due to incompatible data formats and the need to enable feature flags. Manual steps are therefore required to enable RabbitMQ feature in each version. For more details, see Feature Flags — RabbitMQ.

Migration from RabbitMQ 3.x (Mirrored Queues) to 4.x (Quorum Queues)

Starting with Operator version 25.1 or later, RabbitMQ 4.x and quorum queues are used by default. Quorum queues are designed for high availability and require at least three pods (nodes) to operate reliably.

To migrate from mirrored queues to quorum queues, use one of the following options.

Option 1: Reset the RabbitMQ Storage

  1. Scale down the Deploy pods:
    kubectl patch digitalaideploys.xld.digital.ai dai-xld -n digitalai \
    --type=merge \
    --patch '{"spec": {"master": {"replicaCount": 0}, "worker": {"replicaCount": 0}}}'
  2. Scale down RabbitMQ to 0:
    kubectl patch digitalaideploys.xld.digital dai-xld -n digitalai \
    --type=merge \
    --patch '{"spec": {"rabbitmq": {"replicaCount": 0}}}'
  3. Perform the upgrade:
    xl kube upgrade
  4. Delete all RabbitMQ PVCs:
    kubectl delete pvc data-dai-xld-rabbitmq-0 -n digitalai
    kubectl delete pvc data-dai-xld-rabbitmq-1 -n digitalai
    kubectl delete pvc data-dai-xld-rabbitmq-2 -n digitalai
  5. Scale RabbitMQ back up:
    kubectl patch digitalaideploys.xld.digital dai-xld -n digitalai \
    --type=merge \
    --patch '{"spec": {"rabbitmq": {"replicaCount": 3}}}'
  6. Restore the Deploy master and worker pods:
    kubectl patch digitalaideploys.xld.digital dai-xld -n digitalai \
    --type=merge \
    --patch '{"spec": {"master": {"replicaCount": 3}, "worker": {"replicaCount": 3}}}'

Option 2: Recommendation from RabbitMQ

Manual Upgrade Between RabbitMQ 4.x Versions

If you're already using RabbitMQ 4.x with quorum queues and need to upgrade to a newer 4.x version (such as, from 4.0.x to 4.1.x), follow these steps:

  1. Scale down the Deploy pods:

    kubectl patch digitalaideployments.deploy.digital.ai dai-xld -n digitalai \
    --type=merge \
    --patch '{"spec": {"replicaCount": 0}}'
  2. Enable all available feature flags:

    kubectl exec -n digitalai dai-xld-rabbitmq-0 -c rabbitmq -- \
    rabbitmqctl list_feature_flags

    kubectl exec -n digitalai dai-xld-rabbitmq-0 -c rabbitmq -- \
    rabbitmqctl enable_feature_flag all
  3. Patch the RabbitMQ image version (explicit or default):

    Option 1: Set a specific version, for example 4.0.9

    Explicitly set the RabbitMQ image tag to a known version.

    kubectl patch -n digitalai Digitalaideploys dai-xlr \
    --type=merge --patch '{"spec": {"rabbitmq": {"image": {"tag": "4.0.9"}}}}'

    Option 2: Remove the image tag to use the operator’s default (latest supported version)

    To move to the default version provided by the current operator, clear the image tag field:

    kubectl patch -n digitalai Digitalaideploys dai-xlr \
    --type=merge --patch '{"spec": {"rabbitmq": {"image": null}}}'
  4. Restore the Deploy pods to the replica count used before the upgrade (e.g., 1):

    kubectl patch digitalaideployments.deploy.digital.ai dai-xld -n digitalai \
    --type=merge \
    --patch '{"spec": {"replicaCount": 1}}'

    Adjust the value 1 to match the original replica count used in your environment.