Class JmsDefaultRedeliveryPolicy

java.lang.Object
org.apache.qpid.jms.policy.JmsDefaultRedeliveryPolicy
All Implemented Interfaces:
JmsRedeliveryPolicy

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

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
     
    int
    Returns the configured maximum redeliveries that a message will be allowed to have before it is rejected by this client.
    int
    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
    Returns the configured default outcome that will be used when rejecting messages.
    int
    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
     
    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(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
  • Field Details

  • Constructor Details

    • JmsDefaultRedeliveryPolicy

      public JmsDefaultRedeliveryPolicy()
    • JmsDefaultRedeliveryPolicy

      public JmsDefaultRedeliveryPolicy(JmsDefaultRedeliveryPolicy source)
  • Method Details

    • copy

      Specified by:
      copy in interface JmsRedeliveryPolicy
    • 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(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 Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object