Spring Batch
  1. Spring Batch
  2. BATCH-1396

Late binding of commit-interval, e.g. bound from job parameters.

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 2.1.7
    • Component/s: Core
    • Labels:
      None

      Description

      The StepExecutionSimpleCompletionPolicy has played this but role for commit interval. It would be nice to be able to bind other runtime values into a step.

        Activity

        Hide
        Stéphane Nicoll added a comment -

        We are also interested by this feature as well. What we would need is to be able to get an instance of the particular Job and customize it for a particular execution.

        Things that we may want to override is the following:

        • commit-interval of a step
        • task executor configuration of a step (consider a single process, multi-threaded steps where we want to raise or decrease the maximum number of concurrent threads before executing a particular job)

        We also need something consistent for retries (e.g. apply the same customizations if the job failed and is restarted) but that's definitely something very specific that we can do on our end, provided we have the flexibility to get a callback when it is restarted

        Show
        Stéphane Nicoll added a comment - We are also interested by this feature as well. What we would need is to be able to get an instance of the particular Job and customize it for a particular execution. Things that we may want to override is the following: commit-interval of a step task executor configuration of a step (consider a single process, multi-threaded steps where we want to raise or decrease the maximum number of concurrent threads before executing a particular job) We also need something consistent for retries (e.g. apply the same customizations if the job failed and is restarted) but that's definitely something very specific that we can do on our end, provided we have the flexibility to get a callback when it is restarted
        Hide
        Dave Syer added a comment -

        As mentioned in the description there is a StepExecutionSimpleCompletionPolicy that works for the commit interval use case.

        Task executors are normally configurable dynamically anyway - just change the thread pool settings before you launch the job. You can even do it remotely with JMX or similar (they were designed for this uses case). Not much that Spring Batch can add there unless I missed something.

        Show
        Dave Syer added a comment - As mentioned in the description there is a StepExecutionSimpleCompletionPolicy that works for the commit interval use case. Task executors are normally configurable dynamically anyway - just change the thread pool settings before you launch the job. You can even do it remotely with JMX or similar (they were designed for this uses case). Not much that Spring Batch can add there unless I missed something.
        Hide
        Dave Syer added a comment -

        For 2.1.7 we have added a step-scoped bean definition for the CompletionPolicy in a TaskletStep, assuming the commit-interval provided in the <chunk/> element starts with "#". This is much easier to use than StepExecutionSimpleCompletionPolicy.

        Show
        Dave Syer added a comment - For 2.1.7 we have added a step-scoped bean definition for the CompletionPolicy in a TaskletStep, assuming the commit-interval provided in the <chunk/> element starts with "#". This is much easier to use than StepExecutionSimpleCompletionPolicy.
        Hide
        Dave Syer added a comment -

        I'm going to roll back the changes in 2.1.7 in respect retry-limit and skip-limit because they cause too many problems with step inheritance (parent="..." in a step). You can still do late binding of those values by injecting a retry-policy or skip-policy.

        Show
        Dave Syer added a comment - I'm going to roll back the changes in 2.1.7 in respect retry-limit and skip-limit because they cause too many problems with step inheritance (parent="..." in a step). You can still do late binding of those values by injecting a retry-policy or skip-policy.

          People

          • Assignee:
            Dave Syer
            Reporter:
            Dave Syer
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 0.75d
              0.75d
              Remaining:
              Remaining Estimate - 0.75d
              0.75d
              Logged:
              Time Spent - Not Specified
              Not Specified