java.lang.Object
org.springframework.batch.core.step.AbstractStep
org.springframework.batch.integration.remote.RemoteStep
All Implemented Interfaces:
Step, StoppableStep, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean

public class RemoteStep extends AbstractStep
A Step implementation that delegates the execution to a remote worker step through messaging.

The remote worker step must be listening to the same message channel to receive step execution requests.

The step execution is created locally and sent to the remote worker step which will update its status and context in the job repository. The RemoteStep will poll the job repository to check for step completion.

Since:
6.0.0
Author:
Mahmoud Ben Hassine
  • Constructor Details

    • RemoteStep

      public RemoteStep(String name, String remoteStepName, JobRepository jobRepository, org.springframework.integration.core.MessagingTemplate messagingTemplate)
      Create a new RemoteStep instance.
      Parameters:
      name - the name of this step
      remoteStepName - the name of the remote worker step to execute
      jobRepository - the job repository to use
      messagingTemplate - the messaging template to use to send step execution requests
  • Method Details

    • setTimeout

      public void setTimeout(long timeout)
    • setPollInterval

      public void setPollInterval(long pollInterval)
    • setMessageChannel

      public void setMessageChannel(org.springframework.messaging.MessageChannel messageChannel)
    • doExecute

      protected void doExecute(StepExecution stepExecution) throws Exception
      Description copied from class: AbstractStep
      Extension point for subclasses to execute business logic. Subclasses should set the ExitStatus on the StepExecution before returning.
      Specified by:
      doExecute in class AbstractStep
      Parameters:
      stepExecution - the current step context
      Throws:
      Exception - checked exception thrown by implementation