Class RemoteChunkingManagerStepBuilder<I,O>
java.lang.Object
org.springframework.batch.core.step.builder.StepBuilderHelper<AbstractTaskletStepBuilder<B>>
org.springframework.batch.core.step.builder.AbstractTaskletStepBuilder<SimpleStepBuilder<I,O>>
org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O>
org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
org.springframework.batch.integration.chunk.RemoteChunkingManagerStepBuilder<I,O>
- Type Parameters:
I- type of input itemsO- type of output items
Builder for a manager step in a remote chunking setup. This builder creates and
sets a
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
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) Create a newRemoteChunkingManagerStepBuilder. -
Method Summary
Modifier and TypeMethodDescriptionallowStartIfComplete(boolean allowStartIfComplete) backOffPolicy(org.springframework.retry.backoff.BackOffPolicy backOffPolicy) build()Build a managerTaskletStep.chunk(int chunkSize) chunk(org.springframework.batch.repeat.CompletionPolicy completionPolicy) chunkOperations(org.springframework.batch.repeat.RepeatOperations repeatTemplate) exceptionHandler(org.springframework.batch.repeat.exception.ExceptionHandler exceptionHandler) inputChannel(org.springframework.messaging.PollableChannel inputChannel) Set the input channel on which replies from workers will be received.keyGenerator(KeyGenerator keyGenerator) listener(ChunkListener listener) listener(ItemReadListener<? super I> listener) listener(ItemWriteListener<? super O> listener) listener(SkipListener<? super I, ? super O> listener) 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.repository(JobRepository jobRepository) retryContextCache(org.springframework.retry.policy.RetryContextCache retryContextCache) retryLimit(int retryLimit) retryPolicy(org.springframework.retry.RetryPolicy retryPolicy) skipLimit(int skipLimit) skipPolicy(SkipPolicy skipPolicy) startLimit(int startLimit) stepOperations(org.springframework.batch.repeat.RepeatOperations repeatTemplate) stream(org.springframework.batch.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, processor, registerAsStreamsAndListeners, registerStepListenerAsItemListenerMethods inherited from class org.springframework.batch.core.step.builder.AbstractTaskletStepBuilder
concurrent, getExceptionHandler, getStepOperations, getStreams, getTaskExecutor, getThrottleLimit, getTransactionAttribute, registerStepListenerAsChunkListener, taskExecutor, throttleLimitMethods inherited from class org.springframework.batch.core.step.builder.StepBuilderHelper
enhance, getJobRepository, getName, getTransactionManager, isAllowStartIfComplete
-
Constructor Details
-
RemoteChunkingManagerStepBuilder
Create a newRemoteChunkingManagerStepBuilder.- Parameters:
stepName- name of the manager step
-
-
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
Build a managerTaskletStep.- Overrides:
buildin classFaultTolerantStepBuilder<I,O> - Returns:
- the configured manager step
- See Also:
-
reader
public RemoteChunkingManagerStepBuilder<I,O> reader(org.springframework.batch.item.ItemReader<? extends I> reader) - Overrides:
readerin classSimpleStepBuilder<I,O>
-
repository
- Overrides:
repositoryin classStepBuilderHelper<AbstractTaskletStepBuilder<SimpleStepBuilder<I,O>>>
-
transactionManager
public RemoteChunkingManagerStepBuilder<I,O> transactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) - Overrides:
transactionManagerin classStepBuilderHelper<AbstractTaskletStepBuilder<SimpleStepBuilder<I,O>>>
-
listener
- Overrides:
listenerin classFaultTolerantStepBuilder<I,O>
-
listener
- Overrides:
listenerin classFaultTolerantStepBuilder<I,O>
-
listener
- Overrides:
listenerin classFaultTolerantStepBuilder<I,O>
-
transactionAttribute
public RemoteChunkingManagerStepBuilder<I,O> transactionAttribute(org.springframework.transaction.interceptor.TransactionAttribute transactionAttribute) - Overrides:
transactionAttributein classFaultTolerantStepBuilder<I,O>
-
listener
public RemoteChunkingManagerStepBuilder<I,O> listener(org.springframework.retry.RetryListener listener) - Overrides:
listenerin classFaultTolerantStepBuilder<I,O>
-
keyGenerator
- Overrides:
keyGeneratorin classFaultTolerantStepBuilder<I,O>
-
retryLimit
- Overrides:
retryLimitin classFaultTolerantStepBuilder<I,O>
-
retryPolicy
public RemoteChunkingManagerStepBuilder<I,O> retryPolicy(org.springframework.retry.RetryPolicy retryPolicy) - Overrides:
retryPolicyin classFaultTolerantStepBuilder<I,O>
-
backOffPolicy
public RemoteChunkingManagerStepBuilder<I,O> backOffPolicy(org.springframework.retry.backoff.BackOffPolicy backOffPolicy) - Overrides:
backOffPolicyin classFaultTolerantStepBuilder<I,O>
-
retryContextCache
public RemoteChunkingManagerStepBuilder<I,O> retryContextCache(org.springframework.retry.policy.RetryContextCache retryContextCache) - Overrides:
retryContextCachein classFaultTolerantStepBuilder<I,O>
-
skipLimit
- Overrides:
skipLimitin classFaultTolerantStepBuilder<I,O>
-
noSkip
- Overrides:
noSkipin classFaultTolerantStepBuilder<I,O>
-
skip
- Overrides:
skipin classFaultTolerantStepBuilder<I,O>
-
skipPolicy
- Overrides:
skipPolicyin classFaultTolerantStepBuilder<I,O>
-
noRollback
- Overrides:
noRollbackin classFaultTolerantStepBuilder<I,O>
-
noRetry
- Overrides:
noRetryin classFaultTolerantStepBuilder<I,O>
-
retry
- Overrides:
retryin classFaultTolerantStepBuilder<I,O>
-
stream
public RemoteChunkingManagerStepBuilder<I,O> stream(org.springframework.batch.item.ItemStream stream) - Overrides:
streamin classFaultTolerantStepBuilder<I,O>
-
chunk
- Overrides:
chunkin classSimpleStepBuilder<I,O>
-
chunk
public RemoteChunkingManagerStepBuilder<I,O> chunk(org.springframework.batch.repeat.CompletionPolicy completionPolicy) - Overrides:
chunkin classSimpleStepBuilder<I,O>
-
writer
public RemoteChunkingManagerStepBuilder<I,O> writer(org.springframework.batch.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 classSimpleStepBuilder<I,O> - Throws:
UnsupportedOperationException- if an item writer is provided- See Also:
-
readerIsTransactionalQueue
- Overrides:
readerIsTransactionalQueuein classSimpleStepBuilder<I,O>
-
listener
- Overrides:
listenerin classSimpleStepBuilder<I,O>
-
listener
- Overrides:
listenerin classSimpleStepBuilder<I,O>
-
chunkOperations
public RemoteChunkingManagerStepBuilder<I,O> chunkOperations(org.springframework.batch.repeat.RepeatOperations repeatTemplate) - Overrides:
chunkOperationsin classSimpleStepBuilder<I,O>
-
exceptionHandler
public RemoteChunkingManagerStepBuilder<I,O> exceptionHandler(org.springframework.batch.repeat.exception.ExceptionHandler exceptionHandler) - Overrides:
exceptionHandlerin classAbstractTaskletStepBuilder<SimpleStepBuilder<I,O>>
-
stepOperations
public RemoteChunkingManagerStepBuilder<I,O> stepOperations(org.springframework.batch.repeat.RepeatOperations repeatTemplate) - Overrides:
stepOperationsin classAbstractTaskletStepBuilder<SimpleStepBuilder<I,O>>
-
startLimit
- Overrides:
startLimitin classStepBuilderHelper<AbstractTaskletStepBuilder<SimpleStepBuilder<I,O>>>
-
listener
- Overrides:
listenerin classStepBuilderHelper<AbstractTaskletStepBuilder<SimpleStepBuilder<I,O>>>
-
allowStartIfComplete
- Overrides:
allowStartIfCompletein classStepBuilderHelper<AbstractTaskletStepBuilder<SimpleStepBuilder<I,O>>>
-
processor
public RemoteChunkingManagerStepBuilder<I,O> processor(org.springframework.batch.item.ItemProcessor<? super I, ? extends O> itemProcessor) - Overrides:
processorin classSimpleStepBuilder<I,O>
-