Interface ContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,O>,O extends ContainerOptions<O,B>>

Type Parameters:
B - the concrete ContainerOptionsBuilder type.
O - the concrete ContainerOptions type.
All Known Subinterfaces:
SqsContainerOptionsBuilder
All Known Implementing Classes:
AbstractContainerOptions.Builder

public interface ContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,O>,O extends ContainerOptions<O,B>>
A builder for creating a ContainerOptions instance.
  • Method Details

    • maxConcurrentMessages

      B maxConcurrentMessages(int maxConcurrentMessages)
      Set the maximum concurrent messages that can be processed simultaneously for each queue. Default is 10. Note that if acknowledgement batching is being used, the actual maximum number of inflight messages might be higher.
      Returns:
      this instance.
    • maxMessagesPerPoll

      B maxMessagesPerPoll(int maxMessagesPerPoll)
      Set the number of messages that should be returned per poll. If a value greater than 10 is provided, the result of multiple polls will be combined, which can be useful for ListenerMode.BATCH Default is 10.
      Parameters:
      maxMessagesPerPoll - the number of messages.
      Returns:
      this instance.
    • maxDelayBetweenPolls

      B maxDelayBetweenPolls(Duration maxDelayBetweenPolls)
      Set the maximum time the polling thread should wait for a full batch of permits to be available before trying to acquire a partial batch if so configured. A poll is only actually executed if at least one permit is available. Default is 10 seconds.
      Parameters:
      maxDelayBetweenPolls - the maximum delay.
      Returns:
      this instance.
      See Also:
    • pollTimeout

      B pollTimeout(Duration pollTimeout)
      Set the timeout for polling messages for this endpoint. Default is 10 seconds.
      Parameters:
      pollTimeout - the poll timeout.
      Returns:
      this instance.
    • listenerMode

      B listenerMode(ListenerMode listenerMode)
      Set the ListenerMode mode for this container. Default is ListenerMode.SINGLE_MESSAGE
      Parameters:
      listenerMode - the listener mode.
      Returns:
      this instance.
    • componentsTaskExecutor

      B componentsTaskExecutor(TaskExecutor taskExecutor)
      Set the TaskExecutor to be used by this container's components. It's shared by the MessageSink and any blocking components the container might have. Due to performance concerns, the provided executor MUST have a MessageExecutionThreadFactory. The container should have enough Threads to support the full load, including if it's shared between containers.
      Parameters:
      taskExecutor - the task executor.
      Returns:
      this instance.
      See Also:
    • acknowledgementResultTaskExecutor

      B acknowledgementResultTaskExecutor(TaskExecutor taskExecutor)
      Set the TaskExecutor to be used by blocking AcknowledgementResultCallback implementations for this container. Due to performance concerns, the provided executor MUST have a MessageExecutionThreadFactory. The container should have enough Threads to support the full load, including if it's shared between containers.
      Parameters:
      taskExecutor - the task executor.
      Returns:
      this instance.
    • listenerShutdownTimeout

      B listenerShutdownTimeout(Duration shutdownTimeout)
      Set the maximum amount of time that the container should wait for tasks to finish before shutting down. Default is 10 seconds.
      Parameters:
      shutdownTimeout - the timeout.
      Returns:
      this instance.
    • acknowledgementShutdownTimeout

      B acknowledgementShutdownTimeout(Duration acknowledgementShutdownTimeout)
      Set the maximum amount of time that the container should wait for batched acknowledgements to finish before * shutting down. Note that this timeout starts counting after listener processing is done or timed out. Default * is 20 seconds. * @param acknowledgementShutdownTimeout the timeout.
      Returns:
      this instance.
    • backPressureMode

      B backPressureMode(BackPressureMode backPressureMode)
      Set the BackPressureMode for this container. Default is BackPressureMode.AUTO
      Parameters:
      backPressureMode - the backpressure mode.
      Returns:
      this instance.
    • acknowledgementInterval

      B acknowledgementInterval(Duration acknowledgementInterval)
      Set the maximum interval between acknowledgements for batch acknowledgements. The default depends on the specific ContainerComponentFactory implementation.
      Parameters:
      acknowledgementInterval - the interval.
      Returns:
      this instance.
    • acknowledgementThreshold

      B acknowledgementThreshold(int acknowledgementThreshold)
      Set the threshold for triggering a batch acknowledgement. The default depends on the specific ContainerComponentFactory implementation.
      Parameters:
      acknowledgementThreshold - the threshold.
      Returns:
      this instance.
    • acknowledgementMode

      B acknowledgementMode(AcknowledgementMode acknowledgementMode)
      Set the AcknowledgementMode for this container. Default is AcknowledgementMode.ON_SUCCESS.
      Parameters:
      acknowledgementMode - the acknowledgement mode.
      Returns:
      this instance.
    • acknowledgementOrdering

      B acknowledgementOrdering(AcknowledgementOrdering acknowledgementOrdering)
      Set the AcknowledgementOrdering for this container. Default is AcknowledgementOrdering.PARALLEL.
      Parameters:
      acknowledgementOrdering - the acknowledgement ordering.
      Returns:
      this instance
    • messageConverter

      B messageConverter(MessagingMessageConverter<?> messageConverter)
      Set the MessagingMessageConverter for this container.
      Parameters:
      messageConverter - the message converter.
      Returns:
      this instance.
    • build

      O build()
      Create the ContainerOptions instance.
      Returns:
      the new instance.
    • createCopy

      B createCopy()
      Create a copy of this builder.
      Returns:
      the copy.
    • fromBuilder

      void fromBuilder(B builder)
      Copy the given builder settings to this builder.
      Parameters:
      builder - the builder from which to copy settings from.