This topic tells you about how to set default policies for the pre-provisioned VMware Tanzu RabbitMQ for Tanzu Application Service service. For setting on-demand policies, see Setting Default RabbitMQ Policies for the On-Demand Service.
ImportantPrevious deprecation warnings for the pre-provisioned service are no longer in effect. VMware continues to support the pre-provisioned service.
You can set a default queue and an exchange policy in the Tanzu RabbitMQ for Tanzu Application Service tile to be applied to the RabbitMQ cluster. After you deploy the tile, VMware recommends that you use the RabbitMQ Management UI to make configuration changes.
For more information about RabbitMQ policies, see the RabbitMQ documentation.
To set or change the policy, see the Set or Change the Policy section below.
The following rules apply to polices set through the Tanzu RabbitMQ for Tanzu Application Service tile:
It is not possible to use pattern matching with policies. Policies apply to all queues and exchanges.
For granular policy settings, VMware recommends using the RabbitMQ Management UI. Set a priority number
lower than 50
, the default priority number
applied through the Ops Manager configuration.
Here is an example policy that ensures messages are mirrored on two nodes:
{
"ha-mode": "exactly",
"ha-params": 2,
"ha-sync-mode": "automatic"
}
Operators should consider some of the performance implications of making queues and exchanges highly available. For more information about highly available queues, see the RabbitMQ documentation.
When a queue syncs all its messages, they are loaded into memory. When queues are syncing, they can use as much memory as the total size of all messages. This applies to both nodes—the node where the queue leader runs (from node) and the node where the queue follower runs (to node), but only applies to newly created queue followers.
This behavior is especially relevant when any change affects the deployment, for example: stemcell updates, deployment configuration changes, and network changes. Verify that you have enough memory and disk available to support all messages.
For example:
There are 5 GB of messages in a mirrored queue that is set to automatic sync. When this queue needs to sync, the node where the queue leader runs can use up to 5 GB of extra memory. The same applies to the node where the new queue follower is created.
To set the RabbitMQ policy:
From the Ops Manager Installation Dashboard, click the Tanzu RabbitMQ for Tanzu Application Service tile and then click the Pre-Provisioned RabbitMQ tab.
Under Deploy Pre-Provisioned service offering, click Yes.
Select Enable custom policy on new instances.
The policy must be valid JSON and should meet valid RabbitMQ policy criteria.
NoteNo policy validation occurs during the deployment, and errors can cause the deployment to fail or policies to be applied incorrectly.
You can view RabbitMQ policies in the RabbitMQ Management UI, shown below. The example policy entered in the Tanzu RabbitMQ for Tanzu Application Service tile above is applied to all queues and given a Priority of 50. This allows you to override it by defining another policy with a higher priority.
In the Queues section shown below, you can see that any new queues created have the policy automatically applied.
NoteDevelopers can obtain the URL of the policy from
VCAP_SERVICES
for app developers.