Activiti
  1. Activiti
  2. ACT-1046

Allow engine to configure a delay between retries and the amount of retries.

    Details

    • Type: New Feature New Feature
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.8
    • Fix Version/s: 5.10
    • Component/s: Engine
    • Labels:
      None
    • Number of attachments :
      3

      Description

      Currently if job execution fail then next execution is made immadiate (three times until sucessfull).
      There can be a small delay depending from the amount of jobs waiting for execution but i think it is insufficient.

      We need more configuration, firs for all:

      • the delay between each retry
      • configurable the amount of retries

      Both values should be configured in JobExecutor.

      i think to allow configure delay between each retries is required a new column NEXT_ATTEMPT_TIME in ACT_RU_JOB table.
      It should be filled and calculeted during job aquisition and recalculated in DecrementJobRetriesCmd after each fail.

      1. ACT-1046_v2.patch
        31 kB
        Dawid Wrzosek
      2. ACT-1046_v3.patch
        12 kB
        Dawid Wrzosek
      3. ACT-1046.patch
        21 kB
        Dawid Wrzosek

        Activity

        Hide
        Dawid Wrzosek added a comment -

        I agree with you. Unnecessarily i wanted to separate those values. I'm going to change the patch and attach it today.
        Do you have any other suggestion ?

        Show
        Dawid Wrzosek added a comment - I agree with you. Unnecessarily i wanted to separate those values. I'm going to change the patch and attach it today. Do you have any other suggestion ?
        Hide
        Dawid Wrzosek added a comment -

        Modified patch attached.
        When can we expect this patch on the trunk ?

        Show
        Dawid Wrzosek added a comment - Modified patch attached. When can we expect this patch on the trunk ?
        Hide
        Daniel Meyer (camunda) added a comment -

        Hi Dawid,

        this is a good addition. I'll try to have a look at it until he end of the week.

        Show
        Daniel Meyer (camunda) added a comment - Hi Dawid, this is a good addition. I'll try to have a look at it until he end of the week.
        Hide
        Roman Smirnov (camunda) added a comment -

        In discussion with Daniel we found another way to handle the configuration of a delay between retries and the amount of retries.

        For that we provide a listener "FailedJobListener" and an interface "FailedJobCommandFactory". The "FailedJobListener" replaces the "DecrementJobRetriesListener" which previously was used in the class "ExecuteJobsCmd". The new listener uses the factory to create an instance of a command to handle a failed job. Activiti uses by default the "DefaultJobCommandFactory" which implements the new interface to create an instance of the command "DecrementJobRetriesCmd" to provide the logic as previously.

        Now you can implement your own strategy to handle failed jobs. For example you can implement a strategy to distinguish between the type of the failed job and handle them differently (e.g. set another delay or the the amount of retries).

        See revision: 3372

        Show
        Roman Smirnov (camunda) added a comment - In discussion with Daniel we found another way to handle the configuration of a delay between retries and the amount of retries. For that we provide a listener "FailedJobListener" and an interface "FailedJobCommandFactory". The "FailedJobListener" replaces the "DecrementJobRetriesListener" which previously was used in the class "ExecuteJobsCmd". The new listener uses the factory to create an instance of a command to handle a failed job. Activiti uses by default the "DefaultJobCommandFactory" which implements the new interface to create an instance of the command "DecrementJobRetriesCmd" to provide the logic as previously. Now you can implement your own strategy to handle failed jobs. For example you can implement a strategy to distinguish between the type of the failed job and handle them differently (e.g. set another delay or the the amount of retries). See revision: 3372
        Hide
        Bernd Ruecker (camunda) added a comment -

        I consider this as done. As an example (and proof ) we hooked in a more powerful strategy in the fox ee version: https://app.camunda.com/confluence/display/foxUserGuide/Custom+Job+Retry+Strategy

        Show
        Bernd Ruecker (camunda) added a comment - I consider this as done. As an example (and proof ) we hooked in a more powerful strategy in the fox ee version: https://app.camunda.com/confluence/display/foxUserGuide/Custom+Job+Retry+Strategy

          People

          • Assignee:
            Daniel Meyer (camunda)
            Reporter:
            Dawid Wrzosek
          • Votes:
            4 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: