I
- type of input itemsO
- type of output itemspublic class RemoteChunkingManagerStepBuilder<I,O> extends FaultTolerantStepBuilder<I,O>
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.
StepBuilderHelper.CommonStepProperties
chunkListeners
logger, properties
Constructor and Description |
---|
RemoteChunkingManagerStepBuilder(java.lang.String stepName)
Create a new
RemoteChunkingManagerStepBuilder . |
Modifier and Type | Method and Description |
---|---|
RemoteChunkingManagerStepBuilder<I,O> |
allowStartIfComplete(boolean allowStartIfComplete) |
RemoteChunkingManagerStepBuilder<I,O> |
backOffPolicy(org.springframework.retry.backoff.BackOffPolicy backOffPolicy)
Provide a backoff policy to prevent items being retried immediately (e.g.
|
TaskletStep |
build()
Build a manager
TaskletStep . |
RemoteChunkingManagerStepBuilder<I,O> |
chunk(CompletionPolicy completionPolicy)
Sets a completion policy for the chunk processing.
|
RemoteChunkingManagerStepBuilder<I,O> |
chunk(int chunkSize)
Sets the chunk size or commit interval for this step.
|
RemoteChunkingManagerStepBuilder<I,O> |
chunkOperations(RepeatOperations repeatTemplate)
Instead of a
chunk size or completion policy you can provide
a complete repeat operations instance that handles the iteration over the item reader. |
RemoteChunkingManagerStepBuilder<I,O> |
exceptionHandler(ExceptionHandler exceptionHandler)
Sets the exception handler to use in the case of tasklet failures.
|
RemoteChunkingManagerStepBuilder<I,O> |
inputChannel(org.springframework.messaging.PollableChannel inputChannel)
Set the input channel on which replies from workers will be received.
|
RemoteChunkingManagerStepBuilder<I,O> |
keyGenerator(KeyGenerator keyGenerator)
Sets the key generator for identifying retried items.
|
RemoteChunkingManagerStepBuilder<I,O> |
listener(ChunkListener listener)
Register a chunk listener.
|
RemoteChunkingManagerStepBuilder<I,O> |
listener(ItemReadListener<? super I> listener)
Register an item reader listener.
|
RemoteChunkingManagerStepBuilder<I,O> |
listener(ItemWriteListener<? super O> listener)
Register an item writer listener.
|
RemoteChunkingManagerStepBuilder<I,O> |
listener(java.lang.Object listener)
Registers objects using the annotation based listener configuration.
|
RemoteChunkingManagerStepBuilder<I,O> |
listener(org.springframework.retry.RetryListener listener)
Register a retry listener.
|
RemoteChunkingManagerStepBuilder<I,O> |
listener(SkipListener<? super I,? super O> listener)
Register a skip listener.
|
RemoteChunkingManagerStepBuilder<I,O> |
listener(StepExecutionListener listener) |
RemoteChunkingManagerStepBuilder<I,O> |
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.
|
RemoteChunkingManagerStepBuilder<I,O> |
messagingTemplate(org.springframework.integration.core.MessagingTemplate messagingTemplate)
Set the
MessagingTemplate to use to send data to workers. |
RemoteChunkingManagerStepBuilder<I,O> |
noRetry(java.lang.Class<? extends java.lang.Throwable> type)
Explicitly ask for an exception (and subclasses) to be excluded from retry.
|
RemoteChunkingManagerStepBuilder<I,O> |
noRollback(java.lang.Class<? extends java.lang.Throwable> type)
Mark this exception as ignorable during item read or processing operations.
|
RemoteChunkingManagerStepBuilder<I,O> |
noSkip(java.lang.Class<? extends java.lang.Throwable> type)
Explicitly prevent certain exceptions (and subclasses) from being skipped.
|
RemoteChunkingManagerStepBuilder<I,O> |
outputChannel(org.springframework.messaging.MessageChannel outputChannel)
Set the output channel on which requests to workers will be sent.
|
RemoteChunkingManagerStepBuilder<I,O> |
processor(ItemProcessor<? super I,? extends O> itemProcessor)
An item processor that processes or transforms a stream of items.
|
RemoteChunkingManagerStepBuilder<I,O> |
reader(ItemReader<? extends I> reader)
An item reader that provides a stream of items.
|
RemoteChunkingManagerStepBuilder<I,O> |
readerIsTransactionalQueue()
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.
|
RemoteChunkingManagerStepBuilder<I,O> |
repository(JobRepository jobRepository) |
RemoteChunkingManagerStepBuilder<I,O> |
retry(java.lang.Class<? extends java.lang.Throwable> type)
Explicitly ask for an exception (and subclasses) to be retried.
|
RemoteChunkingManagerStepBuilder<I,O> |
retryContextCache(org.springframework.retry.policy.RetryContextCache retryContextCache)
Provide an explicit retry context cache.
|
RemoteChunkingManagerStepBuilder<I,O> |
retryLimit(int retryLimit)
The maximum number of times to try a failed item.
|
RemoteChunkingManagerStepBuilder<I,O> |
retryPolicy(org.springframework.retry.RetryPolicy retryPolicy)
Provide an explicit retry policy instead of using the
FaultTolerantStepBuilder.retryLimit(int) and retryable exceptions provided
elsewhere. |
RemoteChunkingManagerStepBuilder<I,O> |
skip(java.lang.Class<? extends java.lang.Throwable> type)
Explicitly request certain exceptions (and subclasses) to be skipped.
|
RemoteChunkingManagerStepBuilder<I,O> |
skipLimit(int skipLimit)
Sets the maximum number of failed items to skip before the step fails.
|
RemoteChunkingManagerStepBuilder<I,O> |
skipPolicy(SkipPolicy skipPolicy)
Provide an explicit policy for managing skips.
|
RemoteChunkingManagerStepBuilder<I,O> |
startLimit(int startLimit) |
RemoteChunkingManagerStepBuilder<I,O> |
stepOperations(RepeatOperations repeatTemplate)
Sets the repeat template used for iterating the tasklet execution.
|
RemoteChunkingManagerStepBuilder<I,O> |
stream(ItemStream stream)
Register a stream for callbacks that manage restart data.
|
RemoteChunkingManagerStepBuilder<I,O> |
throttleLimit(long throttleLimit)
Public setter for the throttle limit.
|
RemoteChunkingManagerStepBuilder<I,O> |
transactionAttribute(org.springframework.transaction.interceptor.TransactionAttribute transactionAttribute)
Sets the transaction attributes for the tasklet execution.
|
RemoteChunkingManagerStepBuilder<I,O> |
transactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) |
RemoteChunkingManagerStepBuilder<I,O> |
writer(ItemWriter<? super O> writer)
This method will throw a
UnsupportedOperationException since
the item writer of the manager step in a remote chunking setup will be
automatically set to an instance of ChunkMessageChannelItemWriter . |
createChunkProcessor, createChunkProvider, createRetryOperations, createSkipPolicy, createTasklet, detectStreamInReader, getChunkMonitor, getFatalExceptionAwareProxy, getJsrRetryListeners, getRollbackClassifier, getSkipListeners, listener, processorNonTransactional, registerStepListenerAsSkipListener
createChunkOperations, faultTolerant, getChunkCompletionPolicy, getChunkSize, getItemListeners, getProcessor, getReader, getWriter, isReaderTransactionalQueue, listener, processor, registerAsStreamsAndListeners, registerStepListenerAsItemListener
concurrent, getExceptionHandler, getStepOperations, getStreams, getTaskExecutor, getThrottleLimit, getTransactionAttribute, registerStepListenerAsChunkListener, taskExecutor, throttleLimit
enhance, getJobRepository, getName, getTransactionManager, isAllowStartIfComplete
public RemoteChunkingManagerStepBuilder(java.lang.String stepName)
RemoteChunkingManagerStepBuilder
.stepName
- name of the manager steppublic RemoteChunkingManagerStepBuilder<I,O> inputChannel(org.springframework.messaging.PollableChannel inputChannel)
ChunkMessageChannelItemWriter
created by this builder.inputChannel
- the input channelChunkMessageChannelItemWriter.setReplyChannel(org.springframework.messaging.PollableChannel)
public RemoteChunkingManagerStepBuilder<I,O> outputChannel(org.springframework.messaging.MessageChannel outputChannel)
Use either this setter or messagingTemplate(MessagingTemplate)
to provide a fully configured messaging template.
outputChannel
- the output channel.messagingTemplate(MessagingTemplate)
public RemoteChunkingManagerStepBuilder<I,O> messagingTemplate(org.springframework.integration.core.MessagingTemplate messagingTemplate)
MessagingTemplate
to 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.
messagingTemplate
- the messaging template to useoutputChannel(MessageChannel)
public RemoteChunkingManagerStepBuilder<I,O> maxWaitTimeouts(int maxWaitTimeouts)
maxWaitTimeouts
- the maximum number of wait timeoutsChunkMessageChannelItemWriter.setMaxWaitTimeouts(int)
public RemoteChunkingManagerStepBuilder<I,O> throttleLimit(long throttleLimit)
throttleLimit
- the throttle limit to setChunkMessageChannelItemWriter.setThrottleLimit(long)
public TaskletStep build()
TaskletStep
.build
in class FaultTolerantStepBuilder<I,O>
RemoteChunkHandlerFactoryBean
public RemoteChunkingManagerStepBuilder<I,O> reader(ItemReader<? extends I> reader)
SimpleStepBuilder
AbstractTaskletStepBuilder.stream(ItemStream)
or listener if it implements the corresponding interface. By default assumed to be non-transactional.reader
in class SimpleStepBuilder<I,O>
reader
- an item readerSimpleStepBuilder.readerTransactionalQueue
public RemoteChunkingManagerStepBuilder<I,O> repository(JobRepository jobRepository)
repository
in class StepBuilderHelper<AbstractTaskletStepBuilder<SimpleStepBuilder<I,O>>>
public RemoteChunkingManagerStepBuilder<I,O> transactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
transactionManager
in class StepBuilderHelper<AbstractTaskletStepBuilder<SimpleStepBuilder<I,O>>>
public RemoteChunkingManagerStepBuilder<I,O> listener(java.lang.Object listener)
FaultTolerantStepBuilder
listener
in class FaultTolerantStepBuilder<I,O>
listener
- the object that has a method configured with listener annotationpublic RemoteChunkingManagerStepBuilder<I,O> listener(SkipListener<? super I,? super O> listener)
FaultTolerantStepBuilder
listener
in class FaultTolerantStepBuilder<I,O>
listener
- the listener to registerpublic RemoteChunkingManagerStepBuilder<I,O> listener(ChunkListener listener)
AbstractTaskletStepBuilder
listener
in class FaultTolerantStepBuilder<I,O>
listener
- the listener to registerpublic RemoteChunkingManagerStepBuilder<I,O> transactionAttribute(org.springframework.transaction.interceptor.TransactionAttribute transactionAttribute)
AbstractTaskletStepBuilder
transactionAttribute
in class FaultTolerantStepBuilder<I,O>
transactionAttribute
- a transaction attribute setpublic RemoteChunkingManagerStepBuilder<I,O> listener(org.springframework.retry.RetryListener listener)
FaultTolerantStepBuilder
listener
in class FaultTolerantStepBuilder<I,O>
listener
- the listener to registerpublic RemoteChunkingManagerStepBuilder<I,O> keyGenerator(KeyGenerator keyGenerator)
FaultTolerantStepBuilder
keyGenerator
in class FaultTolerantStepBuilder<I,O>
keyGenerator
- a key generator for the stateful retrypublic RemoteChunkingManagerStepBuilder<I,O> retryLimit(int retryLimit)
FaultTolerantStepBuilder
FaultTolerantStepBuilder.retryPolicy
is set.retryLimit
in class FaultTolerantStepBuilder<I,O>
retryLimit
- the retry limit (default 0)public RemoteChunkingManagerStepBuilder<I,O> retryPolicy(org.springframework.retry.RetryPolicy retryPolicy)
FaultTolerantStepBuilder
FaultTolerantStepBuilder.retryLimit(int)
and retryable exceptions provided
elsewhere. Can be used to retry different exceptions a different number of times, for instance.retryPolicy
in class FaultTolerantStepBuilder<I,O>
retryPolicy
- a retry policypublic RemoteChunkingManagerStepBuilder<I,O> backOffPolicy(org.springframework.retry.backoff.BackOffPolicy backOffPolicy)
FaultTolerantStepBuilder
FaultTolerantStepBuilder.retryPolicy
is
set.backOffPolicy
in class FaultTolerantStepBuilder<I,O>
backOffPolicy
- the back off policy to use (default no backoff)public RemoteChunkingManagerStepBuilder<I,O> retryContextCache(org.springframework.retry.policy.RetryContextCache retryContextCache)
FaultTolerantStepBuilder
retryContextCache
in class FaultTolerantStepBuilder<I,O>
retryContextCache
- cache for retry contexts in between transactions (default to standard in-memory
implementation)public RemoteChunkingManagerStepBuilder<I,O> skipLimit(int skipLimit)
FaultTolerantStepBuilder
FaultTolerantStepBuilder.skipPolicy(SkipPolicy)
is provided.skipLimit
in class FaultTolerantStepBuilder<I,O>
skipLimit
- the skip limit to setpublic RemoteChunkingManagerStepBuilder<I,O> noSkip(java.lang.Class<? extends java.lang.Throwable> type)
FaultTolerantStepBuilder
noSkip
in class FaultTolerantStepBuilder<I,O>
type
- the non-skippable exceptionpublic RemoteChunkingManagerStepBuilder<I,O> skip(java.lang.Class<? extends java.lang.Throwable> type)
FaultTolerantStepBuilder
skip
in class FaultTolerantStepBuilder<I,O>
type
- the exception type.public RemoteChunkingManagerStepBuilder<I,O> skipPolicy(SkipPolicy skipPolicy)
FaultTolerantStepBuilder
skipPolicy
in class FaultTolerantStepBuilder<I,O>
skipPolicy
- the skip policypublic RemoteChunkingManagerStepBuilder<I,O> noRollback(java.lang.Class<? extends java.lang.Throwable> type)
FaultTolerantStepBuilder
noRollback
in class FaultTolerantStepBuilder<I,O>
type
- the exception to mark as no rollbackpublic RemoteChunkingManagerStepBuilder<I,O> noRetry(java.lang.Class<? extends java.lang.Throwable> type)
FaultTolerantStepBuilder
noRetry
in class FaultTolerantStepBuilder<I,O>
type
- the exception to exclude from retrypublic RemoteChunkingManagerStepBuilder<I,O> retry(java.lang.Class<? extends java.lang.Throwable> type)
FaultTolerantStepBuilder
retry
in class FaultTolerantStepBuilder<I,O>
type
- the exception to retrypublic RemoteChunkingManagerStepBuilder<I,O> stream(ItemStream stream)
AbstractTaskletStepBuilder
stream
in class FaultTolerantStepBuilder<I,O>
stream
- the stream to registerpublic RemoteChunkingManagerStepBuilder<I,O> chunk(int chunkSize)
SimpleStepBuilder
SimpleStepBuilder.completionPolicy
.chunk
in class SimpleStepBuilder<I,O>
chunkSize
- the chunk size (a.k.a commit interval)public RemoteChunkingManagerStepBuilder<I,O> chunk(CompletionPolicy completionPolicy)
SimpleStepBuilder
chunk size
(or commit interval).chunk
in class SimpleStepBuilder<I,O>
completionPolicy
- a completion policy for the chunkpublic RemoteChunkingManagerStepBuilder<I,O> writer(ItemWriter<? super O> writer) throws java.lang.UnsupportedOperationException
UnsupportedOperationException
since
the item writer of the manager step in a remote chunking setup will be
automatically set to an instance of ChunkMessageChannelItemWriter
.
When building a manager step for remote chunking, no item writer must be
provided.writer
in class SimpleStepBuilder<I,O>
writer
- an item writerjava.lang.UnsupportedOperationException
- if an item writer is providedChunkMessageChannelItemWriter
,
RemoteChunkHandlerFactoryBean.setChunkWriter(ItemWriter)
public RemoteChunkingManagerStepBuilder<I,O> readerIsTransactionalQueue()
SimpleStepBuilder
readerIsTransactionalQueue
in class SimpleStepBuilder<I,O>
public RemoteChunkingManagerStepBuilder<I,O> listener(ItemReadListener<? super I> listener)
SimpleStepBuilder
listener
in class SimpleStepBuilder<I,O>
listener
- the listener to registerpublic RemoteChunkingManagerStepBuilder<I,O> listener(ItemWriteListener<? super O> listener)
SimpleStepBuilder
listener
in class SimpleStepBuilder<I,O>
listener
- the listener to registerpublic RemoteChunkingManagerStepBuilder<I,O> chunkOperations(RepeatOperations repeatTemplate)
SimpleStepBuilder
chunk size
or completion policy
you can provide
a complete repeat operations instance that handles the iteration over the item reader.chunkOperations
in class SimpleStepBuilder<I,O>
repeatTemplate
- a complete repeat template for the chunkpublic RemoteChunkingManagerStepBuilder<I,O> exceptionHandler(ExceptionHandler exceptionHandler)
AbstractTaskletStepBuilder
exceptionHandler
in class AbstractTaskletStepBuilder<SimpleStepBuilder<I,O>>
exceptionHandler
- the exception handlerpublic RemoteChunkingManagerStepBuilder<I,O> stepOperations(RepeatOperations repeatTemplate)
AbstractTaskletStepBuilder
stepOperations
in class AbstractTaskletStepBuilder<SimpleStepBuilder<I,O>>
repeatTemplate
- a repeat template with rules for iteratingpublic RemoteChunkingManagerStepBuilder<I,O> startLimit(int startLimit)
startLimit
in class StepBuilderHelper<AbstractTaskletStepBuilder<SimpleStepBuilder<I,O>>>
public RemoteChunkingManagerStepBuilder<I,O> listener(StepExecutionListener listener)
listener
in class StepBuilderHelper<AbstractTaskletStepBuilder<SimpleStepBuilder<I,O>>>
public RemoteChunkingManagerStepBuilder<I,O> allowStartIfComplete(boolean allowStartIfComplete)
allowStartIfComplete
in class StepBuilderHelper<AbstractTaskletStepBuilder<SimpleStepBuilder<I,O>>>
public RemoteChunkingManagerStepBuilder<I,O> processor(ItemProcessor<? super I,? extends O> itemProcessor)
SimpleStepBuilder
AbstractTaskletStepBuilder.stream(ItemStream)
or listener if it implements the corresponding interface.processor
in class SimpleStepBuilder<I,O>
itemProcessor
- an item processor