Class RemoteStep
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
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 AbstractStep
observationRegistryFields inherited from interface Step
STEP_TYPE_KEY -
Constructor Summary
ConstructorsConstructorDescriptionRemoteStep(String name, String remoteStepName, JobRepository jobRepository, org.springframework.integration.core.MessagingTemplate messagingTemplate) Create a newRemoteStepinstance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoExecute(StepExecution stepExecution) Extension point for subclasses to execute business logic.voidsetMessageChannel(org.springframework.messaging.MessageChannel messageChannel) voidsetPollInterval(long pollInterval) voidsetTimeout(long timeout) Methods inherited from class AbstractStep
afterPropertiesSet, close, doExecutionRegistration, doExecutionRelease, execute, getCompositeListener, getJobRepository, getName, getStartLimit, isAllowStartIfComplete, open, registerStepExecutionListener, setAllowStartIfComplete, setBeanName, setJobRepository, setName, setObservationRegistry, setStartLimit, setStepExecutionListeners, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface StoppableStep
stop
-
Constructor Details
-
RemoteStep
public RemoteStep(String name, String remoteStepName, JobRepository jobRepository, org.springframework.integration.core.MessagingTemplate messagingTemplate) Create a newRemoteStepinstance.- Parameters:
name- the name of this stepremoteStepName- the name of the remote worker step to executejobRepository- the job repository to usemessagingTemplate- 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
Description copied from class:AbstractStepExtension point for subclasses to execute business logic. Subclasses should set theExitStatuson theStepExecutionbefore returning.- Specified by:
doExecutein classAbstractStep- Parameters:
stepExecution- the current step context- Throws:
Exception- checked exception thrown by implementation
-