Package org.apache.qpid.jms.policy
Class JmsDefaultRedeliveryPolicy
java.lang.Object
org.apache.qpid.jms.policy.JmsDefaultRedeliveryPolicy
- All Implemented Interfaces:
JmsRedeliveryPolicy
Defines the policy used to manage redelivered and recovered Messages.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptioncopy()booleanintReturns the configured maximum redeliveries that a message will be allowed to have before it is rejected by this client.intgetMaxRedeliveries(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.intReturns the configured default outcome that will be used when rejecting messages.intgetOutcome(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.inthashCode()voidsetMaxRedeliveries(int maxRedeliveries) Configures the maximum number of time a message can be redelivered before it will be rejected by this client.voidsetOutcome(int outcome) Set the default outcome to use when rejecting messages using an numeric value, the possible values are:voidsetOutcome(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:
-
Field Details
-
DEFAULT_MAX_REDELIVERIES
public static final int DEFAULT_MAX_REDELIVERIES- See Also:
-
DEFAULT_OUTCOME
public static final int DEFAULT_OUTCOME- See Also:
-
-
Constructor Details
-
JmsDefaultRedeliveryPolicy
public JmsDefaultRedeliveryPolicy() -
JmsDefaultRedeliveryPolicy
-
-
Method Details
-
copy
- Specified by:
copyin interfaceJmsRedeliveryPolicy
-
getMaxRedeliveries
Description copied from interface:JmsRedeliveryPolicyReturns 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:
getMaxRedeliveriesin interfaceJmsRedeliveryPolicy- Parameters:
destination- the destination that the subscription is redelivering from.- Returns:
- the maximum number of redeliveries allowed before a message is rejected.
-
getOutcome
Description copied from interface:JmsRedeliveryPolicyReturns 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:
getOutcomein interfaceJmsRedeliveryPolicy- 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
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() -
equals
-