Class RemoteChunkingManagerStepBuilder<I,O>

java.lang.Object
org.springframework.batch.core.step.builder.StepBuilderHelper<org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O>>
org.springframework.batch.core.step.builder.AbstractTaskletStepBuilder<org.springframework.batch.core.step.builder.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 items
O - type of output items

@NullUnmarked public class RemoteChunkingManagerStepBuilder<I,O> extends org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
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
  • Constructor Details

    • RemoteChunkingManagerStepBuilder

      public RemoteChunkingManagerStepBuilder(String stepName, org.springframework.batch.core.repository.JobRepository jobRepository)
      Parameters:
      stepName - name of the manager step
      jobRepository - 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 the ChunkMessageChannelItemWriter created 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 the 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.

      Parameters:
      messagingTemplate - the messaging template to use
      Returns:
      this builder instance for fluent chaining
      See Also:
    • maxWaitTimeouts

      public 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. 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 RemoteChunkingManagerStepBuilder<I,O> throttleLimit(long 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

      public org.springframework.batch.core.step.tasklet.TaskletStep build()
      Build a manager TaskletStep.
      Overrides:
      build in class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
      Returns:
      the configured manager step
      See Also:
    • reader

      public RemoteChunkingManagerStepBuilder<I,O> reader(org.springframework.batch.infrastructure.item.ItemReader<? extends I> reader)
      Overrides:
      reader in class org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O>
    • transactionManager

      public RemoteChunkingManagerStepBuilder<I,O> transactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
      Overrides:
      transactionManager in class org.springframework.batch.core.step.builder.AbstractTaskletStepBuilder<org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O>>
    • listener

      public RemoteChunkingManagerStepBuilder<I,O> listener(Object listener)
      Overrides:
      listener in class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
    • listener

      public RemoteChunkingManagerStepBuilder<I,O> listener(org.springframework.batch.core.listener.SkipListener<? super I, ? super O> listener)
      Overrides:
      listener in class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
    • listener

      public RemoteChunkingManagerStepBuilder<I,O> listener(org.springframework.batch.core.listener.ChunkListener listener)
      Overrides:
      listener in class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
    • transactionAttribute

      public RemoteChunkingManagerStepBuilder<I,O> transactionAttribute(org.springframework.transaction.interceptor.TransactionAttribute transactionAttribute)
      Overrides:
      transactionAttribute in class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
    • listener

      public RemoteChunkingManagerStepBuilder<I,O> listener(org.springframework.retry.RetryListener listener)
      Overrides:
      listener in class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
    • keyGenerator

      public RemoteChunkingManagerStepBuilder<I,O> keyGenerator(org.springframework.batch.core.step.item.KeyGenerator keyGenerator)
      Overrides:
      keyGenerator in class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
    • retryLimit

      public RemoteChunkingManagerStepBuilder<I,O> retryLimit(int retryLimit)
      Overrides:
      retryLimit in class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
    • retryPolicy

      public RemoteChunkingManagerStepBuilder<I,O> retryPolicy(org.springframework.retry.RetryPolicy retryPolicy)
      Overrides:
      retryPolicy in class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
    • backOffPolicy

      public RemoteChunkingManagerStepBuilder<I,O> backOffPolicy(org.springframework.retry.backoff.BackOffPolicy backOffPolicy)
      Overrides:
      backOffPolicy in class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
    • retryContextCache

      public RemoteChunkingManagerStepBuilder<I,O> retryContextCache(org.springframework.retry.policy.RetryContextCache retryContextCache)
      Overrides:
      retryContextCache in class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
    • skipLimit

      public RemoteChunkingManagerStepBuilder<I,O> skipLimit(int skipLimit)
      Overrides:
      skipLimit in class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
    • noSkip

      public RemoteChunkingManagerStepBuilder<I,O> noSkip(Class<? extends Throwable> type)
      Overrides:
      noSkip in class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
    • skip

      public RemoteChunkingManagerStepBuilder<I,O> skip(Class<? extends Throwable> type)
      Overrides:
      skip in class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
    • skipPolicy

      public RemoteChunkingManagerStepBuilder<I,O> skipPolicy(org.springframework.batch.core.step.skip.SkipPolicy skipPolicy)
      Overrides:
      skipPolicy in class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
    • noRollback

      public RemoteChunkingManagerStepBuilder<I,O> noRollback(Class<? extends Throwable> type)
      Overrides:
      noRollback in class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
    • noRetry

      public RemoteChunkingManagerStepBuilder<I,O> noRetry(Class<? extends Throwable> type)
      Overrides:
      noRetry in class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
    • retry

      public RemoteChunkingManagerStepBuilder<I,O> retry(Class<? extends Throwable> type)
      Overrides:
      retry in class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
    • stream

      public RemoteChunkingManagerStepBuilder<I,O> stream(org.springframework.batch.infrastructure.item.ItemStream stream)
      Overrides:
      stream in class org.springframework.batch.core.step.builder.FaultTolerantStepBuilder<I,O>
    • chunk

      public RemoteChunkingManagerStepBuilder<I,O> chunk(int chunkSize)
      Overrides:
      chunk in class org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O>
    • chunk

      public RemoteChunkingManagerStepBuilder<I,O> chunk(org.springframework.batch.infrastructure.repeat.CompletionPolicy completionPolicy)
      Overrides:
      chunk in class org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O>
    • writer

      public RemoteChunkingManagerStepBuilder<I,O> writer(org.springframework.batch.infrastructure.item.ItemWriter<? super O> writer) throws UnsupportedOperationException
      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.

      When building a manager step for remote chunking, no item writer must be provided.

      Overrides:
      writer in class org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O>
      Throws:
      UnsupportedOperationException - if an item writer is provided
      See Also:
    • readerIsTransactionalQueue

      public RemoteChunkingManagerStepBuilder<I,O> readerIsTransactionalQueue()
      Overrides:
      readerIsTransactionalQueue in class org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O>
    • listener

      public RemoteChunkingManagerStepBuilder<I,O> listener(org.springframework.batch.core.listener.ItemReadListener<? super I> listener)
      Overrides:
      listener in class org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O>
    • listener

      public RemoteChunkingManagerStepBuilder<I,O> listener(org.springframework.batch.core.listener.ItemWriteListener<? super O> listener)
      Overrides:
      listener in class org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O>
    • chunkOperations

      public RemoteChunkingManagerStepBuilder<I,O> chunkOperations(org.springframework.batch.infrastructure.repeat.RepeatOperations repeatTemplate)
      Overrides:
      chunkOperations in class org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O>
    • exceptionHandler

      public RemoteChunkingManagerStepBuilder<I,O> exceptionHandler(org.springframework.batch.infrastructure.repeat.exception.ExceptionHandler exceptionHandler)
      Overrides:
      exceptionHandler in class org.springframework.batch.core.step.builder.AbstractTaskletStepBuilder<org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O>>
    • stepOperations

      public RemoteChunkingManagerStepBuilder<I,O> stepOperations(org.springframework.batch.infrastructure.repeat.RepeatOperations repeatTemplate)
      Overrides:
      stepOperations in class org.springframework.batch.core.step.builder.AbstractTaskletStepBuilder<org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O>>
    • startLimit

      public RemoteChunkingManagerStepBuilder<I,O> startLimit(int startLimit)
      Overrides:
      startLimit in class org.springframework.batch.core.step.builder.StepBuilderHelper<org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O>>
    • listener

      public RemoteChunkingManagerStepBuilder<I,O> listener(org.springframework.batch.core.listener.StepExecutionListener listener)
      Overrides:
      listener in class org.springframework.batch.core.step.builder.StepBuilderHelper<org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O>>
    • allowStartIfComplete

      public RemoteChunkingManagerStepBuilder<I,O> allowStartIfComplete(boolean allowStartIfComplete)
      Overrides:
      allowStartIfComplete in class org.springframework.batch.core.step.builder.StepBuilderHelper<org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O>>
    • processor

      public RemoteChunkingManagerStepBuilder<I,O> processor(org.springframework.batch.infrastructure.item.ItemProcessor<? super I, ? extends O> itemProcessor)
      Overrides:
      processor in class org.springframework.batch.core.step.builder.SimpleStepBuilder<I,O>