Class RemoteChunkingManagerStepBuilder<I,O> 
- Type Parameters:
- I- type of input items
- O- 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 SummaryNested classes/interfaces inherited from class org.springframework.batch.core.step.builder.StepBuilderHelperStepBuilderHelper.CommonStepProperties
- 
Field SummaryFields inherited from class org.springframework.batch.core.step.builder.AbstractTaskletStepBuilderchunkListenersFields inherited from class org.springframework.batch.core.step.builder.StepBuilderHelperlogger, properties
- 
Constructor SummaryConstructorsConstructorDescriptionRemoteChunkingManagerStepBuilder(String stepName) Deprecated, for removal: This API element is subject to removal in a future version.RemoteChunkingManagerStepBuilder(String stepName, JobRepository jobRepository) Create a newRemoteChunkingManagerStepBuilder.
- 
Method SummaryModifier and TypeMethodDescriptionallowStartIfComplete(boolean allowStartIfComplete) backOffPolicy(org.springframework.retry.backoff.BackOffPolicy backOffPolicy) Provide a backoff policy to prevent items being retried immediately (e.g. in case the failure was caused by a remote resource failure that might take some time to be resolved).build()Build a managerTaskletStep.chunk(int chunkSize) Sets the chunk size or commit interval for this step.chunk(CompletionPolicy completionPolicy) Sets a completion policy for the chunk processing.chunkOperations(RepeatOperations repeatTemplate) Instead of achunk sizeorcompletion policyyou can provide a complete repeat operations instance that handles the iteration over the item reader.exceptionHandler(ExceptionHandler exceptionHandler) Sets the exception handler to use in the case of tasklet failures.inputChannel(org.springframework.messaging.PollableChannel inputChannel) Set the input channel on which replies from workers will be received.keyGenerator(KeyGenerator keyGenerator) Sets the key generator for identifying retried items.Registers objects using the annotation based listener configuration.listener(ChunkListener listener) Register a chunk listener.listener(ItemReadListener<? super I> listener) Register an item reader listener.listener(ItemWriteListener<? super O> listener) Register an item writer listener.listener(SkipListener<? super I, ? super O> listener) Register a skip listener.listener(StepExecutionListener listener) listener(org.springframework.retry.RetryListener listener) Register a retry 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.Explicitly ask for an exception (and subclasses) to be excluded from retry.noRollback(Class<? extends Throwable> type) Mark this exception as ignorable during item read or processing operations.Explicitly prevent certain exceptions (and subclasses) from being skipped.outputChannel(org.springframework.messaging.MessageChannel outputChannel) Set the output channel on which requests to workers will be sent.processor(ItemProcessor<? super I, ? extends O> itemProcessor) An item processor that processes or transforms a stream of items.reader(ItemReader<? extends I> reader) An item reader that provides a stream of items.Sets a flag to say that the reader is transactional (usually a queue), which is to say that failed items might be rolled back and re-presented in a subsequent transaction.repository(JobRepository jobRepository) Deprecated, for removal: This API element is subject to removal in a future version.Explicitly ask for an exception (and subclasses) to be retried.retryContextCache(org.springframework.retry.policy.RetryContextCache retryContextCache) Provide an explicit retry context cache.retryLimit(int retryLimit) The maximum number of times to try a failed item.retryPolicy(org.springframework.retry.RetryPolicy retryPolicy) Provide an explicit retry policy instead of using theFaultTolerantStepBuilder.retryLimit(int)and retryable exceptions provided elsewhere.Explicitly request certain exceptions (and subclasses) to be skipped.skipLimit(int skipLimit) Sets the maximum number of failed items to skip before the step fails.skipPolicy(SkipPolicy skipPolicy) Provide an explicit policy for managing skips.startLimit(int startLimit) stepOperations(RepeatOperations repeatTemplate) Sets the repeat template used for iterating the tasklet execution.stream(ItemStream stream) Register a stream for callbacks that manage restart data.throttleLimit(long throttleLimit) Public setter for the throttle limit.transactionAttribute(org.springframework.transaction.interceptor.TransactionAttribute transactionAttribute) Sets the transaction attributes for the tasklet execution.transactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) Set the transaction manager to use for the step.writer(ItemWriter<? super O> writer) 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.FaultTolerantStepBuildercreateChunkProcessor, createChunkProvider, createRetryOperations, createSkipPolicy, createTasklet, detectStreamInReader, faultTolerant, getChunkMonitor, getFatalExceptionAwareProxy, getRollbackClassifier, getSkipListeners, processorNonTransactional, registerStepListenerAsSkipListenerMethods inherited from class org.springframework.batch.core.step.builder.SimpleStepBuildercreateChunkOperations, getChunkCompletionPolicy, getChunkSize, getItemListeners, getProcessor, getReader, getWriter, isReaderTransactionalQueue, listener, registerAsStreamsAndListeners, registerStepListenerAsItemListener, selfMethods inherited from class org.springframework.batch.core.step.builder.AbstractTaskletStepBuilderconcurrent, getExceptionHandler, getStepOperations, getStreams, getTaskExecutor, getThrottleLimit, getTransactionAttribute, getTransactionManager, registerStepListenerAsChunkListener, taskExecutor, throttleLimitMethods inherited from class org.springframework.batch.core.step.builder.StepBuilderHelperenhance, getJobRepository, getName, isAllowStartIfComplete, meterRegistry, observationConvention, observationRegistry
- 
Constructor Details- 
RemoteChunkingManagerStepBuilderDeprecated, for removal: This API element is subject to removal in a future version.Create a newRemoteChunkingManagerStepBuilder.- Parameters:
- stepName- name of the manager step
 
- 
RemoteChunkingManagerStepBuilderCreate a newRemoteChunkingManagerStepBuilder.- Parameters:
- stepName- name of the manager step
- jobRepository- the job repository the step should report to
- Since:
- 5.0
 
 
- 
- 
Method Details- 
inputChannelpublic 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:
 
- 
outputChannelpublic 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:
 
- 
messagingTemplatepublic 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:
 
- 
maxWaitTimeoutsThe 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:
 
- 
throttleLimitPublic 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:
 
- 
buildBuild a managerTaskletStep.- Overrides:
- buildin class- FaultTolerantStepBuilder<I,- O> 
- Returns:
- the configured manager step
- See Also:
 
- 
readerDescription copied from class:SimpleStepBuilderAn item reader that provides a stream of items. Will be automatically registered as aAbstractTaskletStepBuilder.stream(ItemStream)or listener if it implements the corresponding interface. By default assumed to be non-transactional.- Overrides:
- readerin class- SimpleStepBuilder<I,- O> 
- Parameters:
- reader- an item reader
- Returns:
- this for fluent chaining
- See Also:
- 
- SimpleStepBuilder.readerTransactionalQueue
 
 
- 
repository@Deprecated(since="5.1", forRemoval=true) public RemoteChunkingManagerStepBuilder<I,O> repository(JobRepository jobRepository) Deprecated, for removal: This API element is subject to removal in a future version.Set the job repository- Overrides:
- repositoryin class- StepBuilderHelper<SimpleStepBuilder<I,- O>> 
- Parameters:
- jobRepository- the repository to set
- Returns:
- this to enable fluent chaining
 
- 
transactionManagerpublic RemoteChunkingManagerStepBuilder<I,O> transactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) Description copied from class:AbstractTaskletStepBuilderSet the transaction manager to use for the step.- Overrides:
- transactionManagerin class- AbstractTaskletStepBuilder<SimpleStepBuilder<I,- O>> 
- Parameters:
- transactionManager- a transaction manager
- Returns:
- this for fluent chaining
 
- 
listenerDescription copied from class:FaultTolerantStepBuilderRegisters objects using the annotation based listener configuration.- Overrides:
- listenerin class- FaultTolerantStepBuilder<I,- O> 
- Parameters:
- listener- the object that has a method configured with listener annotation
- Returns:
- this for fluent chaining
 
- 
listenerDescription copied from class:FaultTolerantStepBuilderRegister a skip listener.- Overrides:
- listenerin class- FaultTolerantStepBuilder<I,- O> 
- Parameters:
- listener- the listener to register
- Returns:
- this for fluent chaining
 
- 
listenerDescription copied from class:AbstractTaskletStepBuilderRegister a chunk listener.- Overrides:
- listenerin class- FaultTolerantStepBuilder<I,- O> 
- Parameters:
- listener- the listener to register
- Returns:
- this for fluent chaining
 
- 
transactionAttributepublic RemoteChunkingManagerStepBuilder<I,O> transactionAttribute(org.springframework.transaction.interceptor.TransactionAttribute transactionAttribute) Description copied from class:AbstractTaskletStepBuilderSets the transaction attributes for the tasklet execution. Defaults to the default values for the transaction manager, but can be manipulated to provide longer timeouts for instance.- Overrides:
- transactionAttributein class- FaultTolerantStepBuilder<I,- O> 
- Parameters:
- transactionAttribute- a transaction attribute set
- Returns:
- this for fluent chaining
 
- 
listenerpublic RemoteChunkingManagerStepBuilder<I,O> listener(org.springframework.retry.RetryListener listener) Description copied from class:FaultTolerantStepBuilderRegister a retry listener.- Overrides:
- listenerin class- FaultTolerantStepBuilder<I,- O> 
- Parameters:
- listener- the listener to register
- Returns:
- this for fluent chaining
 
- 
keyGeneratorDescription copied from class:FaultTolerantStepBuilderSets the key generator for identifying retried items. Retry across transaction boundaries requires items to be identified when they are encountered again. The default strategy is to use the items themselves, relying on their own implementation to ensure that they can be identified. Often a key generator is not necessary as long as the items have reliable hash code and equals implementations, or the reader is not transactional (the default) and the item processor either is itself not transactional (not the default) or does not create new items.- Overrides:
- keyGeneratorin class- FaultTolerantStepBuilder<I,- O> 
- Parameters:
- keyGenerator- a key generator for the stateful retry
- Returns:
- this for fluent chaining
 
- 
retryLimitDescription copied from class:FaultTolerantStepBuilderThe maximum number of times to try a failed item. Zero and one both translate to try only once and do not retry. Ignored if an explicitFaultTolerantStepBuilder.retryPolicyis set.- Overrides:
- retryLimitin class- FaultTolerantStepBuilder<I,- O> 
- Parameters:
- retryLimit- the retry limit (default 0)
- Returns:
- this for fluent chaining
 
- 
retryPolicypublic RemoteChunkingManagerStepBuilder<I,O> retryPolicy(org.springframework.retry.RetryPolicy retryPolicy) Description copied from class:FaultTolerantStepBuilderProvide an explicit retry policy instead of using theFaultTolerantStepBuilder.retryLimit(int)and retryable exceptions provided elsewhere. Can be used to retry different exceptions a different number of times, for instance.- Overrides:
- retryPolicyin class- FaultTolerantStepBuilder<I,- O> 
- Parameters:
- retryPolicy- a retry policy
- Returns:
- this for fluent chaining
 
- 
backOffPolicypublic RemoteChunkingManagerStepBuilder<I,O> backOffPolicy(org.springframework.retry.backoff.BackOffPolicy backOffPolicy) Description copied from class:FaultTolerantStepBuilderProvide a backoff policy to prevent items being retried immediately (e.g. in case the failure was caused by a remote resource failure that might take some time to be resolved). Ignored if an explicitFaultTolerantStepBuilder.retryPolicyis set.- Overrides:
- backOffPolicyin class- FaultTolerantStepBuilder<I,- O> 
- Parameters:
- backOffPolicy- the back off policy to use (default no backoff)
- Returns:
- this for fluent chaining
 
- 
retryContextCachepublic RemoteChunkingManagerStepBuilder<I,O> retryContextCache(org.springframework.retry.policy.RetryContextCache retryContextCache) Description copied from class:FaultTolerantStepBuilderProvide an explicit retry context cache. Retry is stateful across transactions in the case of failures in item processing or writing, so some information about the context for subsequent retries has to be stored.- Overrides:
- retryContextCachein class- FaultTolerantStepBuilder<I,- O> 
- Parameters:
- retryContextCache- cache for retry contexts in between transactions (default to standard in-memory implementation)
- Returns:
- this for fluent chaining
 
- 
skipLimitDescription copied from class:FaultTolerantStepBuilderSets the maximum number of failed items to skip before the step fails. The default value is 10.This limit is enforced using the default LimitCheckingItemSkipPolicy. If a customSkipPolicyis provided viaFaultTolerantStepBuilder.skipPolicy(SkipPolicy), this limit will not be enforced by the step directly, but it can be implemented to be honored by the custom policy.- Overrides:
- skipLimitin class- FaultTolerantStepBuilder<I,- O> 
- Parameters:
- skipLimit- the maximum number of failed items to skip.
- Returns:
- this for fluent chaining.
- See Also:
 
- 
noSkipDescription copied from class:FaultTolerantStepBuilderExplicitly prevent certain exceptions (and subclasses) from being skipped.- Overrides:
- noSkipin class- FaultTolerantStepBuilder<I,- O> 
- Parameters:
- type- the non-skippable exception
- Returns:
- this for fluent chaining
 
- 
skipDescription copied from class:FaultTolerantStepBuilderExplicitly request certain exceptions (and subclasses) to be skipped. These exceptions (and their subclasses) might be thrown during any phase of the chunk processing (read, process, write) but separate counts are made of skips on read, process and write inside the step execution.- Overrides:
- skipin class- FaultTolerantStepBuilder<I,- O> 
- Parameters:
- type- the exception type.
- Returns:
- this for fluent chaining
 
- 
skipPolicyDescription copied from class:FaultTolerantStepBuilderProvide an explicit policy for managing skips. A skip policy determines which exceptions are skippable and how many times.Note that setting a custom policy overrides the default limit-checking behavior configured via FaultTolerantStepBuilder.skipLimit(int).- Overrides:
- skipPolicyin class- FaultTolerantStepBuilder<I,- O> 
- Parameters:
- skipPolicy- the skip policy
- Returns:
- this for fluent chaining
 
- 
noRollbackDescription copied from class:FaultTolerantStepBuilderMark this exception as ignorable during item read or processing operations. Processing continues with no additional callbacks (use skips instead if you need to be notified). Ignored during write because there is no guarantee of skip and retry without rollback.- Overrides:
- noRollbackin class- FaultTolerantStepBuilder<I,- O> 
- Parameters:
- type- the exception to mark as no rollback
- Returns:
- this for fluent chaining
 
- 
noRetryDescription copied from class:FaultTolerantStepBuilderExplicitly ask for an exception (and subclasses) to be excluded from retry.- Overrides:
- noRetryin class- FaultTolerantStepBuilder<I,- O> 
- Parameters:
- type- the exception to exclude from retry
- Returns:
- this for fluent chaining
 
- 
retryDescription copied from class:FaultTolerantStepBuilderExplicitly ask for an exception (and subclasses) to be retried.- Overrides:
- retryin class- FaultTolerantStepBuilder<I,- O> 
- Parameters:
- type- the exception to retry
- Returns:
- this for fluent chaining
 
- 
streamDescription copied from class:AbstractTaskletStepBuilderRegister a stream for callbacks that manage restart data.- Overrides:
- streamin class- FaultTolerantStepBuilder<I,- O> 
- Parameters:
- stream- the stream to register
- Returns:
- this for fluent chaining
 
- 
chunkDescription copied from class:SimpleStepBuilderSets the chunk size or commit interval for this step. This is the maximum number of items that will be read before processing starts in a single transaction. Not compatible withSimpleStepBuilder.completionPolicy.- Overrides:
- chunkin class- SimpleStepBuilder<I,- O> 
- Parameters:
- chunkSize- the chunk size (a.k.a commit interval)
- Returns:
- this for fluent chaining
 
- 
chunkDescription copied from class:SimpleStepBuilderSets a completion policy for the chunk processing. Items are read until this policy determines that a chunk is complete, giving more control than with just thechunk size(or commit interval).- Overrides:
- chunkin class- SimpleStepBuilder<I,- O> 
- Parameters:
- completionPolicy- a completion policy for the chunk
- Returns:
- this for fluent chaining
 
- 
writerpublic RemoteChunkingManagerStepBuilder<I,O> writer(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 class- SimpleStepBuilder<I,- O> 
- Parameters:
- writer- an item writer
- Returns:
- this for fluent chaining
- Throws:
- UnsupportedOperationException- if an item writer is provided
- See Also:
 
- 
readerIsTransactionalQueueDescription copied from class:SimpleStepBuilderSets a flag to say that the reader is transactional (usually a queue), which is to say that failed items might be rolled back and re-presented in a subsequent transaction. Default is false, meaning that the items are read outside a transaction and possibly cached.- Overrides:
- readerIsTransactionalQueuein class- SimpleStepBuilder<I,- O> 
- Returns:
- this for fluent chaining
 
- 
listenerDescription copied from class:SimpleStepBuilderRegister an item reader listener.- Overrides:
- listenerin class- SimpleStepBuilder<I,- O> 
- Parameters:
- listener- the listener to register
- Returns:
- this for fluent chaining
 
- 
listenerDescription copied from class:SimpleStepBuilderRegister an item writer listener.- Overrides:
- listenerin class- SimpleStepBuilder<I,- O> 
- Parameters:
- listener- the listener to register
- Returns:
- this for fluent chaining
 
- 
chunkOperationsDescription copied from class:SimpleStepBuilderInstead of achunk sizeorcompletion policyyou can provide a complete repeat operations instance that handles the iteration over the item reader.- Overrides:
- chunkOperationsin class- SimpleStepBuilder<I,- O> 
- Parameters:
- repeatTemplate- a complete repeat template for the chunk
- Returns:
- this for fluent chaining
 
- 
exceptionHandlerDescription copied from class:AbstractTaskletStepBuilderSets the exception handler to use in the case of tasklet failures. Default is to rethrow everything.- Overrides:
- exceptionHandlerin class- AbstractTaskletStepBuilder<SimpleStepBuilder<I,- O>> 
- Parameters:
- exceptionHandler- the exception handler
- Returns:
- this for fluent chaining
 
- 
stepOperationsDescription copied from class:AbstractTaskletStepBuilderSets the repeat template used for iterating the tasklet execution. By default it will terminate only when the tasklet returns FINISHED (or null).- Overrides:
- stepOperationsin class- AbstractTaskletStepBuilder<SimpleStepBuilder<I,- O>> 
- Parameters:
- repeatTemplate- a repeat template with rules for iterating
- Returns:
- this for fluent chaining
 
- 
startLimit- Overrides:
- startLimitin class- StepBuilderHelper<SimpleStepBuilder<I,- O>> 
 
- 
listener- Overrides:
- listenerin class- StepBuilderHelper<SimpleStepBuilder<I,- O>> 
 
- 
allowStartIfComplete- Overrides:
- allowStartIfCompletein class- StepBuilderHelper<SimpleStepBuilder<I,- O>> 
 
- 
processorpublic RemoteChunkingManagerStepBuilder<I,O> processor(ItemProcessor<? super I, ? extends O> itemProcessor) Description copied from class:SimpleStepBuilderAn item processor that processes or transforms a stream of items. Will be automatically registered as aAbstractTaskletStepBuilder.stream(ItemStream)or listener if it implements the corresponding interface.- Overrides:
- processorin class- SimpleStepBuilder<I,- O> 
- Parameters:
- itemProcessor- an item processor
- Returns:
- this for fluent chaining
 
 
- 
RemoteChunkingManagerStepBuilder(String, JobRepository)