Class RemotePartitioningWorkerStepBuilder


public class RemotePartitioningWorkerStepBuilder extends StepBuilder
Builder for a worker step in a remote partitioning setup. This builder creates an IntegrationFlow that:
  • listens to StepExecutionRequests coming from the manager on the input channel
  • invokes the StepExecutionRequestHandler to execute the worker step for each incoming request. The worker step is located using the provided StepLocator. If no StepLocator is provided, a BeanFactoryStepLocator configured with the current BeanFactory will be used
  • replies to the manager on the output channel (when the manager step is configured to aggregate replies from workers). If no output channel is provided, a NullChannel will be used (assuming the manager side is configured to poll the job repository for workers status)
Since:
4.1
Author:
Mahmoud Ben Hassine
  • Constructor Details

    • RemotePartitioningWorkerStepBuilder

      @Deprecated(since="5.0", forRemoval=true) public RemotePartitioningWorkerStepBuilder(String name)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Initialize a step builder for a step with the given name.
      Parameters:
      name - the name of the step
    • RemotePartitioningWorkerStepBuilder

      public RemotePartitioningWorkerStepBuilder(String name, JobRepository jobRepository)
      Initialize a step builder for a step with the given name.
      Parameters:
      name - the name of the step
      jobRepository - the job repository to which the step should report to
      Since:
      5.0
  • Method Details

    • inputChannel

      public RemotePartitioningWorkerStepBuilder inputChannel(org.springframework.messaging.MessageChannel inputChannel)
      Set the input channel on which step execution requests sent by the manager are received.
      Parameters:
      inputChannel - the input channel
      Returns:
      this builder instance for fluent chaining
    • outputChannel

      public RemotePartitioningWorkerStepBuilder outputChannel(org.springframework.messaging.MessageChannel outputChannel)
      Set the output channel on which replies will be sent to the manager step.
      Parameters:
      outputChannel - the input channel
      Returns:
      this builder instance for fluent chaining
    • jobExplorer

      public RemotePartitioningWorkerStepBuilder jobExplorer(JobExplorer jobExplorer)
      Set the job explorer.
      Parameters:
      jobExplorer - the job explorer to use
      Returns:
      this builder instance for fluent chaining
    • stepLocator

      public RemotePartitioningWorkerStepBuilder stepLocator(StepLocator stepLocator)
      Set the step locator used to locate the worker step to execute.
      Parameters:
      stepLocator - the step locator to use
      Returns:
      this builder instance for fluent chaining
    • beanFactory

      public RemotePartitioningWorkerStepBuilder beanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
      Set the bean factory.
      Parameters:
      beanFactory - the bean factory
      Returns:
      this builder instance for fluent chaining
    • repository

      public RemotePartitioningWorkerStepBuilder repository(JobRepository jobRepository)
      Overrides:
      repository in class StepBuilderHelper<StepBuilder>
    • startLimit

      public RemotePartitioningWorkerStepBuilder startLimit(int startLimit)
      Overrides:
      startLimit in class StepBuilderHelper<StepBuilder>
    • listener

      public RemotePartitioningWorkerStepBuilder listener(Object listener)
      Description copied from class: StepBuilderHelper
      Registers objects using the annotation based listener configuration.
      Overrides:
      listener in class StepBuilderHelper<StepBuilder>
      Parameters:
      listener - the object that has a method configured with listener annotation
      Returns:
      this for fluent chaining
    • listener

      Overrides:
      listener in class StepBuilderHelper<StepBuilder>
    • allowStartIfComplete

      public RemotePartitioningWorkerStepBuilder allowStartIfComplete(boolean allowStartIfComplete)
      Overrides:
      allowStartIfComplete in class StepBuilderHelper<StepBuilder>
    • tasklet

      @Deprecated(since="5.0", forRemoval=true) public TaskletStepBuilder tasklet(Tasklet tasklet)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: StepBuilder
      Build a step with a custom tasklet, not necessarily item processing.
      Overrides:
      tasklet in class StepBuilder
      Parameters:
      tasklet - a tasklet
      Returns:
      a TaskletStepBuilder
    • tasklet

      public TaskletStepBuilder tasklet(Tasklet tasklet, org.springframework.transaction.PlatformTransactionManager transactionManager)
      Description copied from class: StepBuilder
      Build a step with a custom tasklet, not necessarily item processing.
      Overrides:
      tasklet in class StepBuilder
      Parameters:
      tasklet - a tasklet
      transactionManager - the transaction manager to use for the tasklet
      Returns:
      a TaskletStepBuilder
    • chunk

      @Deprecated(since="5.0", forRemoval=true) public <I, O> SimpleStepBuilder<I,O> chunk(int chunkSize)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: StepBuilder
      Build a step that processes items in chunks with the size provided. To extend the step to being fault tolerant, call the SimpleStepBuilder.faultTolerant() method on the builder. In most cases you will want to parameterize your call to this method, to preserve the type safety of your readers and writers, e.g.
       new StepBuilder("step1").<Order, Ledger> chunk(100).reader(new OrderReader()).writer(new LedgerWriter())
       // ... etc.
       
      Overrides:
      chunk in class StepBuilder
      Type Parameters:
      I - the type of item to be processed as input
      O - the type of item to be output
      Parameters:
      chunkSize - the chunk size (commit interval)
      Returns:
      a SimpleStepBuilder
    • chunk

      public <I, O> SimpleStepBuilder<I,O> chunk(int chunkSize, org.springframework.transaction.PlatformTransactionManager transactionManager)
      Description copied from class: StepBuilder
      Build a step that processes items in chunks with the size provided. To extend the step to being fault tolerant, call the SimpleStepBuilder.faultTolerant() method on the builder. In most cases you will want to parameterize your call to this method, to preserve the type safety of your readers and writers, e.g.
       new StepBuilder("step1").<Order, Ledger> chunk(100, transactionManager).reader(new OrderReader()).writer(new LedgerWriter())
       // ... etc.
       
      Overrides:
      chunk in class StepBuilder
      Type Parameters:
      I - the type of item to be processed as input
      O - the type of item to be output
      Parameters:
      chunkSize - the chunk size (commit interval)
      transactionManager - the transaction manager to use for the chunk-oriented tasklet
      Returns:
      a SimpleStepBuilder
    • chunk

      @Deprecated(since="5.0", forRemoval=true) public <I, O> SimpleStepBuilder<I,O> chunk(CompletionPolicy completionPolicy)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: StepBuilder
      Build a step that processes items in chunks with the completion policy provided. To extend the step to being fault tolerant, call the SimpleStepBuilder.faultTolerant() method on the builder. In most cases you will want to parameterize your call to this method, to preserve the type safety of your readers and writers, e.g.
       new StepBuilder("step1").<Order, Ledger> chunk(100).reader(new OrderReader()).writer(new LedgerWriter())
       // ... etc.
       
      Overrides:
      chunk in class StepBuilder
      Type Parameters:
      I - the type of item to be processed as input
      O - the type of item to be output
      Parameters:
      completionPolicy - the completion policy to use to control chunk processing
      Returns:
      a SimpleStepBuilder
    • chunk

      public <I, O> SimpleStepBuilder<I,O> chunk(CompletionPolicy completionPolicy, org.springframework.transaction.PlatformTransactionManager transactionManager)
      Description copied from class: StepBuilder
      Build a step that processes items in chunks with the completion policy provided. To extend the step to being fault tolerant, call the SimpleStepBuilder.faultTolerant() method on the builder. In most cases you will want to parameterize your call to this method, to preserve the type safety of your readers and writers, e.g.
       new StepBuilder("step1").<Order, Ledger> chunk(100, transactionManager).reader(new OrderReader()).writer(new LedgerWriter())
       // ... etc.
       
      Overrides:
      chunk in class StepBuilder
      Type Parameters:
      I - the type of item to be processed as input
      O - the type of item to be output
      Parameters:
      completionPolicy - the completion policy to use to control chunk processing
      transactionManager - the transaction manager to use for the chunk-oriented tasklet
      Returns:
      a SimpleStepBuilder
    • partitioner

      public PartitionStepBuilder partitioner(String stepName, Partitioner partitioner)
      Description copied from class: StepBuilder
      Create a partition step builder for a remote (or local) step.
      Overrides:
      partitioner in class StepBuilder
      Parameters:
      stepName - the name of the remote or delegate step
      partitioner - a partitioner to be used to construct new step executions
      Returns:
      a PartitionStepBuilder
    • partitioner

      public PartitionStepBuilder partitioner(Step step)
      Description copied from class: StepBuilder
      Create a partition step builder for a remote (or local) step.
      Overrides:
      partitioner in class StepBuilder
      Parameters:
      step - the step to execute in parallel
      Returns:
      a PartitionStepBuilder
    • job

      public JobStepBuilder job(Job job)
      Description copied from class: StepBuilder
      Create a new step builder that will execute a job.
      Overrides:
      job in class StepBuilder
      Parameters:
      job - a job to execute
      Returns:
      a JobStepBuilder
    • flow

      public FlowStepBuilder flow(Flow flow)
      Description copied from class: StepBuilder
      Create a new step builder that will execute a flow.
      Overrides:
      flow in class StepBuilder
      Parameters:
      flow - a flow to execute
      Returns:
      a FlowStepBuilder