Class AMQPFederationPolicySupport


  • public final class AMQPFederationPolicySupport
    extends Object
    Tools used when loading AMQP Broker connections configuration that includes Federation configuration.
    • Field Detail

      • DEFAULT_QUEUE_RECEIVER_PRIORITY_ADJUSTMENT

        public static final int DEFAULT_QUEUE_RECEIVER_PRIORITY_ADJUSTMENT
        Default priority adjustment used for a federation queue match policy if nothing was configured in the broker configuration file.
        See Also:
        Constant Field Values
      • MESSAGE_HOPS_ANNOTATION

        public static final org.apache.qpid.proton.amqp.Symbol MESSAGE_HOPS_ANNOTATION
        Annotation added to received messages from address consumers that indicates how many times the message has traversed a federation link.
      • MESSAGE_HOPS_PROPERTY

        public static final String MESSAGE_HOPS_PROPERTY
        Property value placed on Core messages to indicate number of hops that a message has made when crossing Federation links. This value is used when Core messages are tunneled via an AMQP custom message and then recreated again on the other side.
        See Also:
        Constant Field Values
      • FEDERATED_ADDRESS_SOURCE_PROPERTIES

        public static final org.apache.qpid.proton.amqp.Symbol FEDERATED_ADDRESS_SOURCE_PROPERTIES
        Property name used to embed a nested map of properties meant to be applied if the address indicated in an federation address receiver auto creates the federated address.
    • Constructor Detail

      • AMQPFederationPolicySupport

        public AMQPFederationPolicySupport()
    • Method Detail

      • generateAddressFilter

        public static String generateAddressFilter​(int maxHops)
        Constructs an address filter for a federated address receiver link that deals with both AMQP messages and unwrapped Core messages which can carry different hops markers. If the max is less than or equal to zero no filter is created as these values are used to indicate no max hops for federated messages on an address.
        Parameters:
        maxHops - The max allowed number of hops before a message should stop crossing federation links.
        Returns:
        the address filter string that should be applied (or null).
      • encodeQueuePolicyControlMessage

        public static AMQPMessage encodeQueuePolicyControlMessage​(FederationReceiveFromQueuePolicy policy)
        Create an AMQP Message used to instruct the remote peer that it should perform Federation operations on the given FederationReceiveFromQueuePolicy.
        Parameters:
        policy - The policy to encode into an AMQP message.
        Returns:
        an AMQP Message with the encoded policy.
      • encodeAddressPolicyControlMessage

        public static AMQPMessage encodeAddressPolicyControlMessage​(FederationReceiveFromAddressPolicy policy)
        Create an AMQP Message used to instruct the remote peer that it should perform Federation operations on the given FederationReceiveFromAddressPolicy.
        Parameters:
        policy - The policy to encode into an AMQP message.
        Returns:
        an AMQP Message with the encoded policy.
      • create

        public static FederationReceiveFromAddressPolicy create​(AMQPFederationAddressPolicyElement element,
                                                                WildcardConfiguration wildcards)
        From the broker AMQP broker connection configuration element and the configured wild-card settings create an address match policy.
        Parameters:
        element - The broker connections element configuration that creates this policy.
        wildcards - The configured wild-card settings for the broker or defaults.
        Returns:
        a new address match and handling policy for use in the broker connection.
      • create

        public static FederationReceiveFromQueuePolicy create​(AMQPFederationQueuePolicyElement element,
                                                              WildcardConfiguration wildcards)
        From the broker AMQP broker connection configuration element and the configured wild-card settings create an queue match policy. If not configured otherwise the consumer priority value is always defaulted to a value of -1 in order to attempt to prevent federation consumers from consuming messages on the remote when a local consumer is present.
        Parameters:
        element - The broker connections element configuration that creates this policy.
        wildcards - The configured wild-card settings for the broker or defaults.
        Returns:
        a new queue match and handling policy for use in the broker connection.