Class PolicyInfo

java.lang.Object
org.acemq.rabbitmq.admin.PolicyInfo

public final class PolicyInfo extends Object
A policy: settings applied to whatever matches a pattern.

The thing to understand before using one. A queue argument is fixed at declaration and cannot be changed without deleting the queue; a **policy is applied afterwards and can be changed at any time**. So `x-message-ttl` as an argument is permanent, and the same setting as a policy is editable — which is why operators reach for policies and why a topology comparison that only looks at arguments can be confidently wrong.

Two more traps worth knowing:

  • Only one policy applies. Where several match, the highest priority wins outright — the definitions are not merged. A queue matching a broad policy and a narrow one gets exactly one of them.
  • An argument beats a policy. If a queue was declared with x-message-ttl and a policy also sets it, the argument wins, and the policy appears to do nothing for reasons nothing reports.
  • Constructor Details

  • Method Details

    • name

      public String name()
    • vhost

      public String vhost()
    • pattern

      public String pattern()
      Returns:
      the regular expression matched against queue and exchange names
    • applyTo

      public String applyTo()
      Returns:
      queues, exchanges, classic_queues, quorum_queues or all
    • priority

      public int priority()
      Returns:
      the priority. Where several policies match, the highest wins outright
    • definition

      public Map<String,Object> definition()
      Returns:
      what the policy sets
    • toString

      public String toString()
      Overrides:
      toString in class Object