Class RemoteChunkingManagerStepBuilder<I,O>
- Type Parameters:
I- type of input itemsO- type of output items
ChunkMessageChannelItemWriter on the manager step.
If no messagingTemplate is provided through
messagingTemplate(MessagingTemplate), this
builder will create one and set its default channel to the outputChannel
provided through
outputChannel(MessageChannel).
If a messagingTemplate is provided, it is assumed that it is fully configured
and that its default channel is set to an output channel on which requests to workers
will be sent.
- Since:
- 4.2
- Author:
- Mahmoud Ben Hassine
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.batch.core.step.builder.StepBuilderHelper
org.springframework.batch.core.step.builder.StepBuilderHelper.CommonStepProperties -
Field Summary
Fields inherited from class org.springframework.batch.core.step.builder.AbstractTaskletStepBuilder
chunkListenersFields inherited from class org.springframework.batch.core.step.builder.StepBuilderHelper
logger, properties -
Constructor Summary
ConstructorsConstructorDescriptionRemoteChunkingManagerStepBuilder(String stepName, org.springframework.batch.core.repository.JobRepository jobRepository) Create a newRemoteChunkingManagerStepBuilder. -
Method Summary
Modifier and TypeMethodDescriptionallowStartIfComplete(boolean allowStartIfComplete) backOffPolicy(org.springframework.retry.backoff.BackOffPolicy backOffPolicy) org.springframework.batch.core.step.tasklet.TaskletStepbuild()Build a managerTaskletStep.chunk(int chunkSize) chunk(org.springframework.batch.infrastructure.repeat.CompletionPolicy completionPolicy) chunkOperations(org.springframework.batch.infrastructure.repeat.RepeatOperations repeatTemplate) exceptionHandler(org.springframework.batch.infrastructure.repeat.exception.ExceptionHandler exceptionHandler) inputChannel(org.springframework.messaging.PollableChannel inputChannel) Set the input channel on which replies from workers will be received.keyGenerator(org.springframework.batch.core.step.item.KeyGenerator keyGenerator) listener(org.springframework.batch.core.listener.ChunkListener listener) listener(org.springframework.batch.core.listener.StepExecutionListener listener) listener(org.springframework.retry.RetryListener listener) maxWaitTimeouts(int maxWaitTimeouts) The maximum number of times to wait at the end of a step for a non-null result from the remote workers.messagingTemplate(org.springframework.integration.core.MessagingTemplate messagingTemplate) Set theMessagingTemplateto use to send data to workers.noRollback(Class<? extends Throwable> type) outputChannel(org.springframework.messaging.MessageChannel outputChannel) Set the output channel on which requests to workers will be sent.processor(org.springframework.batch.infrastructure.item.ItemProcessor<? super I, ? extends O> itemProcessor) retryContextCache(org.springframework.retry.policy.RetryContextCache retryContextCache) retryLimit(int retryLimit) retryPolicy(org.springframework.retry.RetryPolicy retryPolicy) skipLimit(int skipLimit) skipPolicy(org.springframework.batch.core.step.skip.SkipPolicy skipPolicy) startLimit(int startLimit) stepOperations(org.springframework.batch.infrastructure.repeat.RepeatOperations repeatTemplate) stream(org.springframework.batch.infrastructure.item.ItemStream stream) throttleLimit(long throttleLimit) Public setter for the throttle limit.transactionAttribute(org.springframework.transaction.interceptor.TransactionAttribute transactionAttribute) transactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) This method will throw aUnsupportedOperationExceptionsince the item writer of the manager step in a remote chunking setup will be automatically set to an instance ofChunkMessageChannelItemWriter.Methods inherited from class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder
createChunkProcessor, createChunkProvider, createRetryOperations, createSkipPolicy, createTasklet, detectStreamInReader, faultTolerant, getChunkMonitor, getFatalExceptionAwareProxy, getRollbackClassifier, getSkipListeners, processorNonTransactional, registerStepListenerAsSkipListenerMethods inherited from class org.springframework.batch.core.step.builder.SimpleStepBuilder
createChunkOperations, getChunkCompletionPolicy, getChunkSize, getItemListeners, getProcessor, getReader, getWriter, isReaderTransactionalQueue, listener, registerAsStreamsAndListeners, registerStepListenerAsItemListener, selfMethods inherited from class org.springframework.batch.core.step.builder.AbstractTaskletStepBuilder
concurrent, getExceptionHandler, getStepOperations, getStreams, getTaskExecutor, getTransactionAttribute, getTransactionManager, registerStepListenerAsChunkListener, taskExecutorMethods inherited from class org.springframework.batch.core.step.builder.StepBuilderHelper
enhance, getJobRepository, getName, isAllowStartIfComplete, observationRegistry
-
Constructor Details
-
RemoteChunkingManagerStepBuilder
public RemoteChunkingManagerStepBuilder(String stepName, org.springframework.batch.core.repository.JobRepository jobRepository) Create a newRemoteChunkingManagerStepBuilder.- Parameters:
stepName- name of the manager stepjobRepository- the job repository the step should report to- Since:
- 5.0
-
-
Method Details
-
inputChannel
public RemoteChunkingManagerStepBuilder<I,O> inputChannel(org.springframework.messaging.PollableChannel inputChannel) Set the input channel on which replies from workers will be received. The provided input channel will be set as a reply channel on theChunkMessageChannelItemWritercreated by this builder.- Parameters:
inputChannel- the input channel- Returns:
- this builder instance for fluent chaining
- See Also:
-
outputChannel
public RemoteChunkingManagerStepBuilder<I,O> outputChannel(org.springframework.messaging.MessageChannel outputChannel) Set the output channel on which requests to workers will be sent. By using this setter, a default messaging template will be created and the output channel will be set as its default channel.Use either this setter or
messagingTemplate(MessagingTemplate)to provide a fully configured messaging template.- Parameters:
outputChannel- the output channel.- Returns:
- this builder instance for fluent chaining
- See Also:
-
messagingTemplate
public RemoteChunkingManagerStepBuilder<I,O> messagingTemplate(org.springframework.integration.core.MessagingTemplate messagingTemplate) Set theMessagingTemplateto use to send data to workers. The default channel of the messaging template must be set.Use either this setter to provide a fully configured messaging template or provide an output channel through
outputChannel(MessageChannel)and a default messaging template will be created.- Parameters:
messagingTemplate- the messaging template to use- Returns:
- this builder instance for fluent chaining
- See Also:
-
maxWaitTimeouts
The maximum number of times to wait at the end of a step for a non-null result from the remote workers. This is a multiplier on the receive timeout set separately on the gateway. The ideal value is a compromise between allowing slow workers time to finish, and responsiveness if there is a dead worker. Defaults to 40.- Parameters:
maxWaitTimeouts- the maximum number of wait timeouts- Returns:
- this builder instance for fluent chaining
- See Also:
-
throttleLimit
Public setter for the throttle limit. This limits the number of pending requests for chunk processing to avoid overwhelming the receivers.- Parameters:
throttleLimit- the throttle limit to set- Returns:
- this builder instance for fluent chaining
- See Also:
-
build
-
reader
-
transactionManager
public RemoteChunkingManagerStepBuilder<I,O> transactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) -
listener
-
listener
-
listener
public RemoteChunkingManagerStepBuilder<I,O> listener(org.springframework.batch.core.listener.ChunkListener listener) -
transactionAttribute
public RemoteChunkingManagerStepBuilder<I,O> transactionAttribute(org.springframework.transaction.interceptor.TransactionAttribute transactionAttribute) -
listener
public RemoteChunkingManagerStepBuilder<I,O> listener(org.springframework.retry.RetryListener listener) -
keyGenerator
public RemoteChunkingManagerStepBuilder<I,O> keyGenerator(org.springframework.batch.core.step.item.KeyGenerator keyGenerator) -
retryLimit
-
retryPolicy
public RemoteChunkingManagerStepBuilder<I,O> retryPolicy(org.springframework.retry.RetryPolicy retryPolicy) -
backOffPolicy
public RemoteChunkingManagerStepBuilder<I,O> backOffPolicy(org.springframework.retry.backoff.BackOffPolicy backOffPolicy) -
retryContextCache
public RemoteChunkingManagerStepBuilder<I,O> retryContextCache(org.springframework.retry.policy.RetryContextCache retryContextCache) -
skipLimit
-
noSkip
-
skip
-
skipPolicy
public RemoteChunkingManagerStepBuilder<I,O> skipPolicy(org.springframework.batch.core.step.skip.SkipPolicy skipPolicy) -
noRollback
-
noRetry
-
retry
-
stream
public RemoteChunkingManagerStepBuilder<I,O> stream(org.springframework.batch.infrastructure.item.ItemStream stream) -
chunk
-
chunk
public RemoteChunkingManagerStepBuilder<I,O> chunk(org.springframework.batch.infrastructure.repeat.CompletionPolicy completionPolicy) -
writer
public RemoteChunkingManagerStepBuilder<I,O> writer(org.springframework.batch.infrastructure.item.ItemWriter<? super O> writer) throws UnsupportedOperationException This method will throw aUnsupportedOperationExceptionsince the item writer of the manager step in a remote chunking setup will be automatically set to an instance ofChunkMessageChannelItemWriter.When building a manager step for remote chunking, no item writer must be provided.
- Overrides:
writerin classorg.springframework.batch.core.step.builder.SimpleStepBuilder<I,O> - Throws:
UnsupportedOperationException- if an item writer is provided- See Also:
-
readerIsTransactionalQueue
-
listener
-
listener
-
chunkOperations
public RemoteChunkingManagerStepBuilder<I,O> chunkOperations(org.springframework.batch.infrastructure.repeat.RepeatOperations repeatTemplate) -
exceptionHandler
public RemoteChunkingManagerStepBuilder<I,O> exceptionHandler(org.springframework.batch.infrastructure.repeat.exception.ExceptionHandler exceptionHandler) -
stepOperations
public RemoteChunkingManagerStepBuilder<I,O> stepOperations(org.springframework.batch.infrastructure.repeat.RepeatOperations repeatTemplate) -
startLimit
-
listener
public RemoteChunkingManagerStepBuilder<I,O> listener(org.springframework.batch.core.listener.StepExecutionListener listener) -
allowStartIfComplete
-
processor
-