Commit ac2a0f51050ce6c7600681da72056f6d003256af

Authored by Dmytro Shvaika
1 parent 9aff0692

removed unnecessary flag

@@ -56,8 +56,6 @@ public class TbRuleEngineProcessingStrategyFactory { @@ -56,8 +56,6 @@ public class TbRuleEngineProcessingStrategyFactory {
56 private final boolean retryTimeout; 56 private final boolean retryTimeout;
57 private final int maxRetries; 57 private final int maxRetries;
58 private final double maxAllowedFailurePercentage; 58 private final double maxAllowedFailurePercentage;
59 -  
60 - private final boolean multiplyPauseBetweenRetries;  
61 private final long maxPauseBetweenRetries; 59 private final long maxPauseBetweenRetries;
62 60
63 private long pauseBetweenRetries; 61 private long pauseBetweenRetries;
@@ -73,7 +71,6 @@ public class TbRuleEngineProcessingStrategyFactory { @@ -73,7 +71,6 @@ public class TbRuleEngineProcessingStrategyFactory {
73 this.maxRetries = configuration.getRetries(); 71 this.maxRetries = configuration.getRetries();
74 this.maxAllowedFailurePercentage = configuration.getFailurePercentage(); 72 this.maxAllowedFailurePercentage = configuration.getFailurePercentage();
75 this.pauseBetweenRetries = configuration.getPauseBetweenRetries(); 73 this.pauseBetweenRetries = configuration.getPauseBetweenRetries();
76 - this.multiplyPauseBetweenRetries = configuration.isMultiplyPauseBetweenRetries();  
77 this.maxPauseBetweenRetries = configuration.getMaxPauseBetweenRetries(); 74 this.maxPauseBetweenRetries = configuration.getMaxPauseBetweenRetries();
78 } 75 }
79 76
@@ -114,7 +111,7 @@ public class TbRuleEngineProcessingStrategyFactory { @@ -114,7 +111,7 @@ public class TbRuleEngineProcessingStrategyFactory {
114 } catch (InterruptedException e) { 111 } catch (InterruptedException e) {
115 throw new RuntimeException(e); 112 throw new RuntimeException(e);
116 } 113 }
117 - if (multiplyPauseBetweenRetries && maxPauseBetweenRetries > pauseBetweenRetries) { 114 + if (maxPauseBetweenRetries > pauseBetweenRetries) {
118 pauseBetweenRetries = Math.min(maxPauseBetweenRetries, pauseBetweenRetries * 2); 115 pauseBetweenRetries = Math.min(maxPauseBetweenRetries, pauseBetweenRetries * 2);
119 } 116 }
120 } 117 }
@@ -725,8 +725,7 @@ queue: @@ -725,8 +725,7 @@ queue:
725 retries: "${TB_QUEUE_RE_MAIN_PROCESSING_STRATEGY_RETRIES:3}" # Number of retries, 0 is unlimited 725 retries: "${TB_QUEUE_RE_MAIN_PROCESSING_STRATEGY_RETRIES:3}" # Number of retries, 0 is unlimited
726 failure-percentage: "${TB_QUEUE_RE_MAIN_PROCESSING_STRATEGY_FAILURE_PERCENTAGE:0}" # Skip retry if failures or timeouts are less then X percentage of messages; 726 failure-percentage: "${TB_QUEUE_RE_MAIN_PROCESSING_STRATEGY_FAILURE_PERCENTAGE:0}" # Skip retry if failures or timeouts are less then X percentage of messages;
727 pause-between-retries: "${TB_QUEUE_RE_MAIN_PROCESSING_STRATEGY_RETRY_PAUSE:3}"# Time in seconds to wait in consumer thread before retries; 727 pause-between-retries: "${TB_QUEUE_RE_MAIN_PROCESSING_STRATEGY_RETRY_PAUSE:3}"# Time in seconds to wait in consumer thread before retries;
728 - multiply-pause-between-retries: "${TB_QUEUE_RE_MAIN_PROCESSING_STRATEGY_MUL_RETRY_PAUSE:false}"# Parameter to enable/disable multiplication of pause value between retries on each iteration;  
729 - max-pause-between-retries: "${TB_QUEUE_RE_MAIN_PROCESSING_STRATEGY_MAX_MUL_RETRY_PAUSE:25}"# Max allowed time in seconds for pause between retries. 728 + max-pause-between-retries: "${TB_QUEUE_RE_MAIN_PROCESSING_STRATEGY_MAX_MUL_RETRY_PAUSE:0}"# Max allowed time in seconds for pause between retries.
730 - name: "${TB_QUEUE_RE_HP_QUEUE_NAME:HighPriority}" 729 - name: "${TB_QUEUE_RE_HP_QUEUE_NAME:HighPriority}"
731 topic: "${TB_QUEUE_RE_HP_TOPIC:tb_rule_engine.hp}" 730 topic: "${TB_QUEUE_RE_HP_TOPIC:tb_rule_engine.hp}"
732 poll-interval: "${TB_QUEUE_RE_HP_POLL_INTERVAL_MS:25}" 731 poll-interval: "${TB_QUEUE_RE_HP_POLL_INTERVAL_MS:25}"
@@ -742,8 +741,7 @@ queue: @@ -742,8 +741,7 @@ queue:
742 retries: "${TB_QUEUE_RE_HP_PROCESSING_STRATEGY_RETRIES:0}" # Number of retries, 0 is unlimited 741 retries: "${TB_QUEUE_RE_HP_PROCESSING_STRATEGY_RETRIES:0}" # Number of retries, 0 is unlimited
743 failure-percentage: "${TB_QUEUE_RE_HP_PROCESSING_STRATEGY_FAILURE_PERCENTAGE:0}" # Skip retry if failures or timeouts are less then X percentage of messages; 742 failure-percentage: "${TB_QUEUE_RE_HP_PROCESSING_STRATEGY_FAILURE_PERCENTAGE:0}" # Skip retry if failures or timeouts are less then X percentage of messages;
744 pause-between-retries: "${TB_QUEUE_RE_HP_PROCESSING_STRATEGY_RETRY_PAUSE:5}"# Time in seconds to wait in consumer thread before retries; 743 pause-between-retries: "${TB_QUEUE_RE_HP_PROCESSING_STRATEGY_RETRY_PAUSE:5}"# Time in seconds to wait in consumer thread before retries;
745 - multiply-pause-between-retries: "${TB_QUEUE_RE_HP_PROCESSING_STRATEGY_MUL_RETRY_PAUSE:false}"# Parameter to enable/disable multiplication of pause value between retries on each iteration;  
746 - max-pause-between-retries: "${TB_QUEUE_RE_HP_PROCESSING_STRATEGY_MAX_MUL_RETRY_PAUSE:120}"# Max allowed time in seconds for pause between retries. 744 + max-pause-between-retries: "${TB_QUEUE_RE_HP_PROCESSING_STRATEGY_MAX_MUL_RETRY_PAUSE:0}"# Max allowed time in seconds for pause between retries.
747 - name: "${TB_QUEUE_RE_SQ_QUEUE_NAME:SequentialByOriginator}" 745 - name: "${TB_QUEUE_RE_SQ_QUEUE_NAME:SequentialByOriginator}"
748 topic: "${TB_QUEUE_RE_SQ_TOPIC:tb_rule_engine.sq}" 746 topic: "${TB_QUEUE_RE_SQ_TOPIC:tb_rule_engine.sq}"
749 poll-interval: "${TB_QUEUE_RE_SQ_POLL_INTERVAL_MS:25}" 747 poll-interval: "${TB_QUEUE_RE_SQ_POLL_INTERVAL_MS:25}"
@@ -759,8 +757,7 @@ queue: @@ -759,8 +757,7 @@ queue:
759 retries: "${TB_QUEUE_RE_SQ_PROCESSING_STRATEGY_RETRIES:3}" # Number of retries, 0 is unlimited 757 retries: "${TB_QUEUE_RE_SQ_PROCESSING_STRATEGY_RETRIES:3}" # Number of retries, 0 is unlimited
760 failure-percentage: "${TB_QUEUE_RE_SQ_PROCESSING_STRATEGY_FAILURE_PERCENTAGE:0}" # Skip retry if failures or timeouts are less then X percentage of messages; 758 failure-percentage: "${TB_QUEUE_RE_SQ_PROCESSING_STRATEGY_FAILURE_PERCENTAGE:0}" # Skip retry if failures or timeouts are less then X percentage of messages;
761 pause-between-retries: "${TB_QUEUE_RE_SQ_PROCESSING_STRATEGY_RETRY_PAUSE:5}"# Time in seconds to wait in consumer thread before retries; 759 pause-between-retries: "${TB_QUEUE_RE_SQ_PROCESSING_STRATEGY_RETRY_PAUSE:5}"# Time in seconds to wait in consumer thread before retries;
762 - multiply-pause-between-retries: "${TB_QUEUE_RE_SQ_PROCESSING_STRATEGY_MUL_RETRY_PAUSE:false}"# Parameter to enable/disable multiplication of pause value between retries on each iteration;  
763 - max-pause-between-retries: "${TB_QUEUE_RE_SQ_PROCESSING_STRATEGY_MAX_MUL_RETRY_PAUSE:120}"# Max allowed time in seconds for pause between retries. 760 + max-pause-between-retries: "${TB_QUEUE_RE_SQ_PROCESSING_STRATEGY_MAX_MUL_RETRY_PAUSE:0}"# Max allowed time in seconds for pause between retries.
764 transport: 761 transport:
765 # For high priority notifications that require minimum latency and processing time 762 # For high priority notifications that require minimum latency and processing time
766 notifications_topic: "${TB_QUEUE_TRANSPORT_NOTIFICATIONS_TOPIC:tb_transport.notifications}" 763 notifications_topic: "${TB_QUEUE_TRANSPORT_NOTIFICATIONS_TOPIC:tb_transport.notifications}"
@@ -24,7 +24,6 @@ public class TbRuleEngineQueueAckStrategyConfiguration { @@ -24,7 +24,6 @@ public class TbRuleEngineQueueAckStrategyConfiguration {
24 private int retries; 24 private int retries;
25 private double failurePercentage; 25 private double failurePercentage;
26 private long pauseBetweenRetries; 26 private long pauseBetweenRetries;
27 - private boolean multiplyPauseBetweenRetries;  
28 private long maxPauseBetweenRetries; 27 private long maxPauseBetweenRetries;
29 28
30 } 29 }