activemq-cpp-3.8.2
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 
40  private:
41 
44 
45  public:
46 
48 
49  virtual ~DefaultRedeliveryPolicy();
50 
51  virtual double getBackOffMultiplier() const {
52  return this->backOffMultiplier;
53  }
54 
55  virtual void setBackOffMultiplier(double value) {
56  this->backOffMultiplier = value;
57  }
58 
59  virtual short getCollisionAvoidancePercent() const;
60 
61  virtual void setCollisionAvoidancePercent(short value);
62 
63  virtual long long getInitialRedeliveryDelay() const {
64  return this->initialRedeliveryDelay;
65  }
66 
67  virtual void setInitialRedeliveryDelay(long long value) {
68  this->initialRedeliveryDelay = value;
69  }
70 
71  virtual long long getRedeliveryDelay() const {
72  return this->redeliveryDelay;
73  }
74 
75  virtual void setRedeliveryDelay(long long value) {
76  this->redeliveryDelay = value;
77  }
78 
79  virtual int getMaximumRedeliveries() const {
80  return this->maximumRedeliveries;
81  }
82 
83  virtual void setMaximumRedeliveries(int value) {
84  this->maximumRedeliveries = value;
85  }
86 
87  virtual bool isUseCollisionAvoidance() const {
88  return this->useCollisionAvoidance;
89  }
90 
91  virtual void setUseCollisionAvoidance(bool value) {
92  this->useCollisionAvoidance = value;
93  }
94 
95  virtual bool isUseExponentialBackOff() const {
96  return this->useExponentialBackOff;
97  }
98 
99  virtual void setUseExponentialBackOff(bool value) {
100  this->useExponentialBackOff = value;
101  }
102 
103  virtual long long getNextRedeliveryDelay(long long previousDelay);
104 
105  virtual RedeliveryPolicy* clone() const;
106 
107  };
108 
109 }}}
110 
111 #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:99
#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:63
virtual bool isUseExponentialBackOff() const
Definition: DefaultRedeliveryPolicy.h:95
virtual long long getRedeliveryDelay() const
Gets the time that redelivery of messages is delayed.
Definition: DefaultRedeliveryPolicy.h:71
virtual bool isUseCollisionAvoidance() const
Definition: DefaultRedeliveryPolicy.h:87
virtual void setUseCollisionAvoidance(bool value)
Definition: DefaultRedeliveryPolicy.h:91
virtual void setRedeliveryDelay(long long value)
Sets the time that redelivery will be delayed.
Definition: DefaultRedeliveryPolicy.h:75
virtual double getBackOffMultiplier() const
Definition: DefaultRedeliveryPolicy.h:51
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: CachedConsumer.h:24
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:79
virtual void setInitialRedeliveryDelay(long long value)
Sets the initial time that redelivery will be delayed.
Definition: DefaultRedeliveryPolicy.h:67
virtual void setBackOffMultiplier(double value)
Sets the Back-Off Multiplier for Message Redelivery.
Definition: DefaultRedeliveryPolicy.h:55
virtual void setMaximumRedeliveries(int value)
Sets the Maximum allowable redeliveries for a Message.
Definition: DefaultRedeliveryPolicy.h:83