activemq-cpp-3.9.0
activemq::core::RedeliveryPolicy Class Referenceabstract

Interface for a RedeliveryPolicy object that controls how message Redelivery is handled in ActiveMQ-CPP when a transaction is rolled back. More...

#include <src/main/activemq/core/RedeliveryPolicy.h>

Inheritance diagram for activemq::core::RedeliveryPolicy:

Public Member Functions

virtual ~RedeliveryPolicy ()
 
virtual double getBackOffMultiplier () const =0
 
virtual void setBackOffMultiplier (double value)=0
 Sets the Back-Off Multiplier for Message Redelivery. More...
 
virtual short getCollisionAvoidancePercent () const =0
 
virtual void setCollisionAvoidancePercent (short value)=0
 
virtual long long getInitialRedeliveryDelay () const =0
 Gets the initial time that redelivery of messages is delayed. More...
 
virtual void setInitialRedeliveryDelay (long long value)=0
 Sets the initial time that redelivery will be delayed. More...
 
virtual long long getRedeliveryDelay () const =0
 Gets the time that redelivery of messages is delayed. More...
 
virtual void setRedeliveryDelay (long long value)=0
 Sets the time that redelivery will be delayed. More...
 
virtual int getMaximumRedeliveries () const =0
 Gets the Maximum number of allowed redeliveries for a message before it will be discarded by the consumer. More...
 
virtual void setMaximumRedeliveries (int maximumRedeliveries)=0
 Sets the Maximum allowable redeliveries for a Message. More...
 
virtual long long getNextRedeliveryDelay (long long previousDelay)=0
 Given the last used redelivery delay calculate the next value of the delay based on the settings in this Policy instance. More...
 
virtual bool isUseCollisionAvoidance () const =0
 
virtual void setUseCollisionAvoidance (bool value)=0
 
virtual bool isUseExponentialBackOff () const =0
 
virtual void setUseExponentialBackOff (bool value)=0
 
virtual long long getMaximumRedeliveryDelay () const =0
 Returns the maximum amount of time that the redelivery delay is allowed to increase to before it is capped. More...
 
virtual void setMaximumRedeliveryDelay (long long value)=0
 Sets the maximum amount of time that the redelivery delay is allowed to increase to before it is capped. More...
 
virtual RedeliveryPolicyclone () const =0
 Create a copy of this Policy and return it. More...
 
virtual void configure (const decaf::util::Properties &properties)
 Checks the supplied properties object for properties matching the configurable settings of this class. More...
 

Static Public Attributes

static const long long NO_MAXIMUM_REDELIVERIES
 

Protected Member Functions

 RedeliveryPolicy ()
 

Detailed Description

Interface for a RedeliveryPolicy object that controls how message Redelivery is handled in ActiveMQ-CPP when a transaction is rolled back.

Since
3.2.0

Constructor & Destructor Documentation

activemq::core::RedeliveryPolicy::RedeliveryPolicy ( )
protected
virtual activemq::core::RedeliveryPolicy::~RedeliveryPolicy ( )
virtual

Member Function Documentation

virtual RedeliveryPolicy* activemq::core::RedeliveryPolicy::clone ( ) const
pure virtual

Create a copy of this Policy and return it.

Returns
pointer to a new RedeliveryPolicy that is a copy of this one.

Implemented in activemq::core::policies::DefaultRedeliveryPolicy.

virtual void activemq::core::RedeliveryPolicy::configure ( const decaf::util::Properties properties)
virtual

Checks the supplied properties object for properties matching the configurable settings of this class.

The default implementation looks for properties named with the prefix cms.RedeliveryPolicy.XXX where XXX is the name of a property with a public setter method. For instance cms.RedeliveryPolicy.useExponentialBackOff will be used to set the value of the use exponential back off toggle.

Subclasses can override this method to add more configuration options or to exclude certain parameters from being set via the properties object.

Parameters
propertiesThe Properties object used to configure this object.
Exceptions
NumberFormatExceptionif a property that is numeric cannot be converted
IllegalArgumentExceptionif a property can't be converted to the correct type.
virtual double activemq::core::RedeliveryPolicy::getBackOffMultiplier ( ) const
pure virtual
Returns
The value of the Back-Off Multiplier for Message Redelivery.

Implemented in activemq::core::policies::DefaultRedeliveryPolicy.

virtual short activemq::core::RedeliveryPolicy::getCollisionAvoidancePercent ( ) const
pure virtual
Returns
the currently set Collision Avoidance percentage.

Implemented in activemq::core::policies::DefaultRedeliveryPolicy.

virtual long long activemq::core::RedeliveryPolicy::getInitialRedeliveryDelay ( ) const
pure virtual

Gets the initial time that redelivery of messages is delayed.

Returns
the time in milliseconds that redelivery is delayed initially.

Implemented in activemq::core::policies::DefaultRedeliveryPolicy.

virtual int activemq::core::RedeliveryPolicy::getMaximumRedeliveries ( ) const
pure virtual

Gets the Maximum number of allowed redeliveries for a message before it will be discarded by the consumer.

Returns
maximum allowed redeliveries for a message.

Implemented in activemq::core::policies::DefaultRedeliveryPolicy.

virtual long long activemq::core::RedeliveryPolicy::getMaximumRedeliveryDelay ( ) const
pure virtual

Returns the maximum amount of time that the redelivery delay is allowed to increase to before it is capped.

Returns
the maximum redelivery delay value.

Implemented in activemq::core::policies::DefaultRedeliveryPolicy.

virtual long long activemq::core::RedeliveryPolicy::getNextRedeliveryDelay ( long long  previousDelay)
pure virtual

Given the last used redelivery delay calculate the next value of the delay based on the settings in this Policy instance.

Parameters
previousDelayThe last delay that was used between message redeliveries.
Returns
the new delay to use before attempting another redelivery.

Implemented in activemq::core::policies::DefaultRedeliveryPolicy.

virtual long long activemq::core::RedeliveryPolicy::getRedeliveryDelay ( ) const
pure virtual

Gets the time that redelivery of messages is delayed.

Returns
the time in milliseconds that redelivery is delayed.

Implemented in activemq::core::policies::DefaultRedeliveryPolicy.

virtual bool activemq::core::RedeliveryPolicy::isUseCollisionAvoidance ( ) const
pure virtual
Returns
whether or not collision avoidance is enabled for this Policy.

Implemented in activemq::core::policies::DefaultRedeliveryPolicy.

virtual bool activemq::core::RedeliveryPolicy::isUseExponentialBackOff ( ) const
pure virtual
Returns
whether or not the exponential back off option is enabled.

Implemented in activemq::core::policies::DefaultRedeliveryPolicy.

virtual void activemq::core::RedeliveryPolicy::setBackOffMultiplier ( double  value)
pure virtual

Sets the Back-Off Multiplier for Message Redelivery.

Parameters
valueThe new value for the back-off multiplier.

Implemented in activemq::core::policies::DefaultRedeliveryPolicy.

virtual void activemq::core::RedeliveryPolicy::setCollisionAvoidancePercent ( short  value)
pure virtual
Parameters
valueThe collision avoidance percentage setting.

Implemented in activemq::core::policies::DefaultRedeliveryPolicy.

virtual void activemq::core::RedeliveryPolicy::setInitialRedeliveryDelay ( long long  value)
pure virtual

Sets the initial time that redelivery will be delayed.

Parameters
valueTime in Milliseconds to wait before starting redelivery.

Implemented in activemq::core::policies::DefaultRedeliveryPolicy.

virtual void activemq::core::RedeliveryPolicy::setMaximumRedeliveries ( int  maximumRedeliveries)
pure virtual

Sets the Maximum allowable redeliveries for a Message.

Parameters
maximumRedeliveriesThe maximum number of times that a message will be redelivered.

Implemented in activemq::core::policies::DefaultRedeliveryPolicy.

virtual void activemq::core::RedeliveryPolicy::setMaximumRedeliveryDelay ( long long  value)
pure virtual

Sets the maximum amount of time that the redelivery delay is allowed to increase to before it is capped.

By default this value is set to -1 which disables any maximum delay.

Parameters
valueThe maximum redelivery delay value in milliseconds.

Implemented in activemq::core::policies::DefaultRedeliveryPolicy.

virtual void activemq::core::RedeliveryPolicy::setRedeliveryDelay ( long long  value)
pure virtual

Sets the time that redelivery will be delayed.

Parameters
valueTime in Milliseconds to wait before the next redelivery.

Implemented in activemq::core::policies::DefaultRedeliveryPolicy.

virtual void activemq::core::RedeliveryPolicy::setUseCollisionAvoidance ( bool  value)
pure virtual
Parameters
valueEnable or Disable collision avoidance for this Policy.

Implemented in activemq::core::policies::DefaultRedeliveryPolicy.

virtual void activemq::core::RedeliveryPolicy::setUseExponentialBackOff ( bool  value)
pure virtual
Parameters
valueEnable or Disable the exponential back off multiplier option.

Implemented in activemq::core::policies::DefaultRedeliveryPolicy.

Field Documentation

const long long activemq::core::RedeliveryPolicy::NO_MAXIMUM_REDELIVERIES
static

The documentation for this class was generated from the following file: