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
22
24
25namespace activemq {
26namespace core {
27namespace policies {
28
29 class AMQCPP_API DefaultRedeliveryPolicy : public RedeliveryPolicy {
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
43 DefaultRedeliveryPolicy(const DefaultRedeliveryPolicy&);
44 DefaultRedeliveryPolicy& operator=(const DefaultRedeliveryPolicy&);
45
46 public:
47
49
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_ */
#define AMQCPP_API
Definition Config.h:30
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 setInitialRedeliveryDelay(long long value)
Sets the initial time that redelivery will be delayed.
Definition DefaultRedeliveryPolicy.h:68
virtual void setCollisionAvoidancePercent(short value)
virtual void setUseExponentialBackOff(bool value)
Definition DefaultRedeliveryPolicy.h:100
virtual bool isUseCollisionAvoidance() const
Definition DefaultRedeliveryPolicy.h:88
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
virtual long long getInitialRedeliveryDelay() const
Gets the initial time that redelivery of messages is delayed.
Definition DefaultRedeliveryPolicy.h:64
virtual void setRedeliveryDelay(long long value)
Sets the time that redelivery will be delayed.
Definition DefaultRedeliveryPolicy.h:76
virtual long long getNextRedeliveryDelay(long long previousDelay)
Given the last used redelivery delay calculate the next value of the delay based on the settings in t...
virtual void setBackOffMultiplier(double value)
Sets the Back-Off Multiplier for Message Redelivery.
Definition DefaultRedeliveryPolicy.h:56
virtual long long getRedeliveryDelay() const
Gets the time that redelivery of messages is delayed.
Definition DefaultRedeliveryPolicy.h:72
virtual RedeliveryPolicy * clone() const
Create a copy of this Policy and return it.
virtual double getBackOffMultiplier() const
Definition DefaultRedeliveryPolicy.h:52
virtual bool isUseExponentialBackOff() const
Definition DefaultRedeliveryPolicy.h:96
virtual void setMaximumRedeliveries(int value)
Sets the Maximum allowable redeliveries for a Message.
Definition DefaultRedeliveryPolicy.h:84
virtual void setUseCollisionAvoidance(bool value)
Definition DefaultRedeliveryPolicy.h:92
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
Definition DefaultPrefetchPolicy.h:27
Definition ActiveMQTempDestination.h:29
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition CachedConsumer.h:24