Class JmsDefaultRedeliveryPolicy

  • All Implemented Interfaces:
    JmsRedeliveryPolicy

    public class JmsDefaultRedeliveryPolicy
    extends java.lang.Object
    implements JmsRedeliveryPolicy
    Defines the policy used to manage redelivered and recovered Messages.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      JmsDefaultRedeliveryPolicy copy()  
      boolean equals​(java.lang.Object obj)  
      int getMaxRedeliveries()
      Returns the configured maximum redeliveries that a message will be allowed to have before it is rejected by this client.
      int getMaxRedeliveries​(JmsDestination destination)
      Returns the configured maximum redeliveries that a message will be allowed to have before it is rejected by this client for a given destination.
      int getOutcome()
      Returns the configured default outcome that will be used when rejecting messages.
      int getOutcome​(JmsDestination destination)
      Returns the configured outcome that will be used when rejecting the message by this client for the given destination when the message has reached the maximum redelivery threshold.
      int hashCode()  
      void setMaxRedeliveries​(int maxRedeliveries)
      Configures the maximum number of time a message can be redelivered before it will be rejected by this client.
      void setOutcome​(int outcome)
      Set the default outcome to use when rejecting messages using an numeric value, the possible values are:
      void setOutcome​(java.lang.String outcome)
      Set the default outcome to use when rejecting messages using a string value which can either be the string version of the numeric outcome values or the string name of the desired outcome, the string names allowed are:
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JmsDefaultRedeliveryPolicy

        public JmsDefaultRedeliveryPolicy()
    • Method Detail

      • getMaxRedeliveries

        public int getMaxRedeliveries​(JmsDestination destination)
        Description copied from interface: JmsRedeliveryPolicy
        Returns the configured maximum redeliveries that a message will be allowed to have before it is rejected by this client for a given destination.

        A return value of less than zero is treated as if there is no maximum value set.

        Specified by:
        getMaxRedeliveries in interface JmsRedeliveryPolicy
        Parameters:
        destination - the destination that the subscription is redelivering from.
        Returns:
        the maximum number of redeliveries allowed before a message is rejected.
      • getOutcome

        public int getOutcome​(JmsDestination destination)
        Description copied from interface: JmsRedeliveryPolicy
        Returns the configured outcome that will be used when rejecting the message by this client for the given destination when the message has reached the maximum redelivery threshold. The outcome returned here maps to AMQP outcomes using the following integer values:

        • ACCEPTED = 1
        • REJECTED = 2
        • RELEASED = 3
        • MODIFIED_FAILED = 4
        • MODIFIED_FAILED_UNDELIVERABLE = 5

        Specified by:
        getOutcome in interface JmsRedeliveryPolicy
        Parameters:
        destination - the destination that the subscription is redelivering from.
        Returns:
        the outcome to use when rejecting messages.
      • getOutcome

        public int getOutcome()
        Returns the configured default outcome that will be used when rejecting messages.

        Default acknowledgement type is Modified with Failed and Undeliverable here set to true.

        Returns:
        the default outcome used when rejecting messages.
      • setOutcome

        public void setOutcome​(int outcome)
        Set the default outcome to use when rejecting messages using an numeric value, the possible values are:

        • ACCEPTED = 1
        • REJECTED = 2
        • RELEASED = 3
        • MODIFIED_FAILED = 4
        • MODIFIED_FAILED_UNDELIVERABLE = 5

        Parameters:
        outcome - the default outcome applied to a rejected delivery.
      • setOutcome

        public void setOutcome​(java.lang.String outcome)
        Set the default outcome to use when rejecting messages using a string value which can either be the string version of the numeric outcome values or the string name of the desired outcome, the string names allowed are:

        • ACCEPTED
        • REJECTED
        • RELEASED
        • MODIFIED_FAILED
        • MODIFIED_FAILED_UNDELIVERABLE

        Parameters:
        outcome - the default outcome applied to a rejected delivery.
      • getMaxRedeliveries

        public int getMaxRedeliveries()
        Returns the configured maximum redeliveries that a message will be allowed to have before it is rejected by this client.
        Returns:
        the maximum number of redeliveries allowed before a message is rejected.
      • setMaxRedeliveries

        public void setMaxRedeliveries​(int maxRedeliveries)
        Configures the maximum number of time a message can be redelivered before it will be rejected by this client. The default value of (-1) disables max redelivery processing.
        Parameters:
        maxRedeliveries - the maxRedeliveries to set
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object