Class RemoteStep

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

public class RemoteStep extends org.springframework.batch.core.step.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
  • Field Summary

    Fields inherited from class org.springframework.batch.core.step.AbstractStep

    observationRegistry

    Fields inherited from interface org.springframework.batch.core.step.Step

    STEP_TYPE_KEY
  • Constructor Summary

    Constructors
    Constructor
    Description
    RemoteStep(String name, String remoteStepName, org.springframework.batch.core.repository.JobRepository jobRepository, org.springframework.integration.core.MessagingTemplate messagingTemplate)
    Create a new RemoteStep instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doExecute(org.springframework.batch.core.step.StepExecution stepExecution)
     
    void
    setMessageChannel(org.springframework.messaging.MessageChannel messageChannel)
     
    void
    setPollInterval(long pollInterval)
     
    void
    setTimeout(long timeout)
     

    Methods inherited from class org.springframework.batch.core.step.AbstractStep

    afterPropertiesSet, close, doExecutionRegistration, doExecutionRelease, execute, getCompositeListener, getJobRepository, getName, getStartLimit, isAllowStartIfComplete, open, registerStepExecutionListener, setAllowStartIfComplete, setBeanName, setJobRepository, setName, setObservationRegistry, setStartLimit, setStepExecutionListeners, toString

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.springframework.batch.core.step.StoppableStep

    stop
  • Constructor Details

    • RemoteStep

      public RemoteStep(String name, String remoteStepName, org.springframework.batch.core.repository.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(org.springframework.batch.core.step.StepExecution stepExecution) throws Exception
      Specified by:
      doExecute in class org.springframework.batch.core.step.AbstractStep
      Throws:
      Exception