synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [synapse] shafreenAnfar commented on a change in pull request #41: Add retry interval feature
Date Mon, 20 Apr 2020 16:10:11 GMT

shafreenAnfar commented on a change in pull request #41:
URL: https://github.com/apache/synapse/pull/41#discussion_r411504565



##########
File path: modules/core/src/main/java/org/apache/synapse/message/processors/forward/ForwardingJob.java
##########
@@ -80,20 +85,31 @@ private void configureForwardingJob(JobDataMap jdm) {
                 ScheduledMessageForwardingProcessor.BLOCKING_SENDER);
         processor = (ScheduledMessageForwardingProcessor) jdm.get(
                 ScheduledMessageForwardingProcessor.PROCESSOR_INSTANCE);
+        retryInterval = 1000;
+
+        setParameters(jdm);
+    }
+
+    private void setParameters(JobDataMap jdm) {
         Map<String, Object> parameters = (Map<String, Object>) jdm.get(MessageProcessorConstants.PARAMETERS);
-        maxDeliverAttempts = extractMaxDeliveryAttempts(parameters, processor);
-        isMaxDeliverAttemptDropEnabled = isMaxDeliverAttemptDropEnabled(parameters);
-        retryHttpStatusCodes(parameters);
-        setSequences(parameters);
+        if (parameters != null) {
+            maxDeliverAttempts = extractMaxDeliveryAttempts(parameters, processor);
+            isMaxDeliverAttemptDropEnabled = isMaxDeliverAttemptDropEnabled(parameters);
+            if (parameters.get(ForwardingProcessorConstants.RETRY_INTERVAL) != null) {
+                retryInterval = Integer.parseInt((String) parameters.get(ForwardingProcessorConstants.RETRY_INTERVAL));

Review comment:
       Thanks for pointing out. I missed it. I have handled the exception by falling back
to default value and also logged the error message.
   
   `2020-04-20 21:35:48,458 [-] [DefaultQuartzScheduler_Worker-1] ERROR ForwardingJob Invalid
value for retry.interval switching back to default value
   `




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


Mime
View raw message