activemq-cpp-3.9.5
DefaultRedeliveryPolicy.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _ACTIVEMQ_CORE_POLICIES_DEFAULTREDELIVERYPOLICY_H_
19 #define _ACTIVEMQ_CORE_POLICIES_DEFAULTREDELIVERYPOLICY_H_
20 
21 #include <activemq/util/Config.h>
22 
24 
25 namespace activemq {
26 namespace core {
27 namespace policies {
28 
30  private:
31 
32  double backOffMultiplier;
33  double collisionAvoidanceFactor;
34  long long initialRedeliveryDelay;
35  int maximumRedeliveries;
36  bool useCollisionAvoidance;
37  bool useExponentialBackOff;
38  long long redeliveryDelay;
39  long long maximumRedeliveryDelay;
40 
41  private:
42 
45 
46  public:
47 
49 
50  virtual ~DefaultRedeliveryPolicy();
51 
52  virtual double getBackOffMultiplier() const {
53  return this->backOffMultiplier;
54  }
55 
56  virtual void setBackOffMultiplier(double value) {
57  this->backOffMultiplier = value;
58  }
59 
60  virtual short getCollisionAvoidancePercent() const;
61 
62  virtual void setCollisionAvoidancePercent(short value);
63 
64  virtual long long getInitialRedeliveryDelay() const {
65  return this->initialRedeliveryDelay;
66  }
67 
68  virtual void setInitialRedeliveryDelay(long long value) {
69  this->initialRedeliveryDelay = value;
70  }
71 
72  virtual long long getRedeliveryDelay() const {
73  return this->redeliveryDelay;
74  }
75 
76  virtual void setRedeliveryDelay(long long value) {
77  this->redeliveryDelay = value;
78  }
79 
80  virtual int getMaximumRedeliveries() const {
81  return this->maximumRedeliveries;
82  }
83 
84  virtual void setMaximumRedeliveries(int value) {
85  this->maximumRedeliveries = value;
86  }
87 
88  virtual bool isUseCollisionAvoidance() const {
89  return this->useCollisionAvoidance;
90  }
91 
92  virtual void setUseCollisionAvoidance(bool value) {
93  this->useCollisionAvoidance = value;
94  }
95 
96  virtual bool isUseExponentialBackOff() const {
97  return this->useExponentialBackOff;
98  }
99 
100  virtual void setUseExponentialBackOff(bool value) {
101  this->useExponentialBackOff = value;
102  }
103 
104  virtual long long getMaximumRedeliveryDelay() const {
105  return this->maximumRedeliveryDelay;
106  }
107 
108  virtual void setMaximumRedeliveryDelay(long long value) {
109  this->maximumRedeliveryDelay = value;
110  }
111 
112  virtual long long getNextRedeliveryDelay(long long previousDelay);
113 
114  virtual RedeliveryPolicy* clone() const;
115 
116  };
117 
118 }}}
119 
120 #endif /* _ACTIVEMQ_CORE_POLICIES_DEFAULTREDELIVERYPOLICY_H_ */
Definition: DefaultRedeliveryPolicy.h:29
Interface for a RedeliveryPolicy object that controls how message Redelivery is handled in ActiveMQ-C...
Definition: RedeliveryPolicy.h:34
virtual void setUseExponentialBackOff(bool value)
Definition: DefaultRedeliveryPolicy.h:100
virtual long long getMaximumRedeliveryDelay() const
Returns the maximum amount of time that the redelivery delay is allowed to increase to before it is c...
Definition: DefaultRedeliveryPolicy.h:104
#define AMQCPP_API
Definition: Config.h:30
virtual long long getInitialRedeliveryDelay() const
Gets the initial time that redelivery of messages is delayed.
Definition: DefaultRedeliveryPolicy.h:64
virtual long long getRedeliveryDelay() const
Gets the time that redelivery of messages is delayed.
Definition: DefaultRedeliveryPolicy.h:72
virtual void setUseCollisionAvoidance(bool value)
Definition: DefaultRedeliveryPolicy.h:92
virtual void setRedeliveryDelay(long long value)
Sets the time that redelivery will be delayed.
Definition: DefaultRedeliveryPolicy.h:76
virtual int getMaximumRedeliveries() const
Gets the Maximum number of allowed redeliveries for a message before it will be discarded by the cons...
Definition: DefaultRedeliveryPolicy.h:80
virtual double getBackOffMultiplier() const
Definition: DefaultRedeliveryPolicy.h:52
virtual void setInitialRedeliveryDelay(long long value)
Sets the initial time that redelivery will be delayed.
Definition: DefaultRedeliveryPolicy.h:68
virtual bool isUseCollisionAvoidance() const
Definition: DefaultRedeliveryPolicy.h:88
virtual bool isUseExponentialBackOff() const
Definition: DefaultRedeliveryPolicy.h:96
virtual void setMaximumRedeliveryDelay(long long value)
Sets the maximum amount of time that the redelivery delay is allowed to increase to before it is capp...
Definition: DefaultRedeliveryPolicy.h:108
virtual void setBackOffMultiplier(double value)
Sets the Back-Off Multiplier for Message Redelivery.
Definition: DefaultRedeliveryPolicy.h:56
virtual void setMaximumRedeliveries(int value)
Sets the Maximum allowable redeliveries for a Message.
Definition: DefaultRedeliveryPolicy.h:84