tencent cloud

Feedback

Policy Management

Last updated: 2024-06-26 16:03:21

    Overview

    In RabbitMQ message queue, besides forced attributes such as durable and Exclusive, when creating a Queue or an Exchange, you can configure some optional attributes to obtain different features, such as x-message-ttl, x-expires, and x-max-length.
    However, once the attribute parameters set for a Queue or an Exchange via RabbitMQ client are successfully set, they cannot be changed unless the original Queue or Exchange is deleted and a new one is created.
    A policy is a special use of runtime parameters that supports dynamically modifying some attribute parameters. Policies are aimed at the Vhost level, and a policy can match one or more Queues or Exchanges, facilitating batch management. This solves the problem that Exchanges and Queues created by RabbitMQ clients cannot be modified, and greatly enhances the flexibility of the application.

    Directions

    Creating a Policy

    When you create a cluster, if mirrored queue is enabled, there will be a default policy under the Policy tab in the console, which can be deleted. You can create a new policy.
    1. Log in to the RabbitMQ Console.
    2. In the left sidebar, choose Cluster Management > Vhost, choose the region, then click the target Vhost's ID to enter the Basic Info page.
    3. Click the Policy tab at the top, click Create Policy, and fill in the Basic Settings of the policy.
    Policy Name: 1-64 characters, can only include digits, letters, hyphens (-), and underscores (_).
    Match Mode: A regular expression used to match the relevant Queue or Exchange. For example, ^test.* will match all Queues or Exchanges that start with test.
    Application Scope: Used to specify the current Policy's effective range.
    Exchanges and queues: Indicates that it applies to all Queues or Exchanges matching the Pattern.
    Exchanges: Indicates that it applies to all Exchanges matching the Pattern.
    Queues: Indicates that it applies to all Queues matching the Pattern.
    Priority: Defines the priority of the Policy. If multiple policies apply to the same Queue or Exchange, the Policy with the highest priority number will be effective.
    
    4. Click Next, to set the Policy Configuration.
    Mirror Mode: The mode of the mirror queue, valid values are all/exactly/nodes.
    all: Indicates that mirror occurs on all nodes in the cluster.
    exactly: Indicates that mirror occurs on a specified number of nodes, as specified by a mirror parameter.
    nodes: Indicates that mirror occurs on specified nodes, with the node names specified by a mirror parameter.
    Message Sync Method: The method of message synchronization in mirror queues, valid values are automatic and manual.
    Primary Node Exit Processing: Whether to allow the election of an unsynchronized mirror as master when the primary node gracefully exits.
    Primary Node Failure Processing: Whether to allow the election of an unsynchronized mirror as master in the event of a primary node failure. To ensure availability, it is recommended to Allow All Mirrors to be elected.
    
    5. Click Complete to finish creating the policy.

    Editing a Policy

    1. In the policy list, click Edit in the Operation column of the target policy.
    2. In the pop-up window, edit the policy information.
    3. Click Submit to complete the modification.

    Deleting a Policy

    1. In the policy list, find the policy you want to delete, and click Delete in the Operation column.
    2. In the pop-up prompt box, click Delete to complete the deletion.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support