Hi … we have a requirement of retry logic—- retry every 10 second for the first minute. After 1 minute, Double the interval of the previous retry until 1 hours overall time . If it is still failed , then move to deadletter queue.
What is the way to implement this logic? I saw somewhere mentioned 3 times default , but you can use ISO 8601 formats as well with custom retry. But I do not think it can meet this requirement.
You can provide your own JobRetryCmd by registering a custom FailedJobCommandFactory when bootstrapping the engine configuration. (Have a look at DefaultJobRetryCmd and DefaultFailedJobCommandFactory) There you can implement your custom logic for handling the retry.
I’d implement it on the process model level, i.e. with a loop in the process. Catch the exception, count the number of failures and implement the logic that computes the delay. And use an itermediate timer event.
You can provide a list of retry periods in the BPMN model - eg PT1M,PT2M,PT5M or in your case PT10S,PT20S,PT30S,PT40S,PT50S,PT60S,PT80S,PT120S,PT200S,PT360S
I like this option. But the follow up question is if I can selectively use this approach , meaning only certain activity use this way, but others are still using standard retry?