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

All Known Implementing Classes:
AbstractContainerOptions, SqsContainerOptions

public interface ContainerOptions<O extends ContainerOptions<O,B>,B extends ContainerOptionsBuilder<B,O>>
Contains the options to be used by the MessageListenerContainer at runtime. Note that after the object has been built by the ContainerOptionsBuilder it's immutable and thread-safe. If a new ContainerOptionsBuilder is created from this object, any changes on it won't reflect on the original instance. Also note that any copies are shallow, meaning that complex objects are not copied but shared between the original instance and the copy.
Since:
3.0
Author:
Tomaz Fernandes
  • Method Details

    • getMaxConcurrentMessages

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

      int getMaxMessagesPerPoll()
      Return the number of messages that should be returned per poll.
      Returns:
      the maximum number of messages per poll.
    • isAutoStartup

      boolean isAutoStartup()
      Checks whether the container should be started automatically or manually. Default is true.
      Returns:
      true if the container starts automatically, false if it should be started manually
    • getMaxDelayBetweenPolls

      Duration getMaxDelayBetweenPolls()
      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.
      Returns:
      the maximum delay between polls.
      See Also:
    • getPollTimeout

      Duration getPollTimeout()
      Return the timeout for polling messages for this endpoint.
      Returns:
      the timeout duration.
    • getPollBackOffPolicy

      default org.springframework.retry.backoff.BackOffPolicy getPollBackOffPolicy()
      Return the BackOffPolicy to be applied when polling throws an exception.
      Returns:
      the timeout duration.
      Since:
      3.2
    • getComponentsTaskExecutor

      @Nullable TaskExecutor getComponentsTaskExecutor()
      Return 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.
      Returns:
      the task executor.
    • getAcknowledgementResultTaskExecutor

      @Nullable TaskExecutor getAcknowledgementResultTaskExecutor()
      Return 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.
      Returns:
      the task executor.
    • getListenerShutdownTimeout

      Duration getListenerShutdownTimeout()
      Return the maximum amount of time that the container should wait for processing tasks to finish before shutting down. Note that when acknowledgement batching is used, the container will also wait for getAcknowledgementShutdownTimeout().
      Returns:
      the timeout.
    • getAcknowledgementShutdownTimeout

      Duration getAcknowledgementShutdownTimeout()
      Return the maximum amount of time that the container should wait for batched acknowledgements to finish before shutting down. This timeout starts counting after listener processing is finished, including due to getListenerShutdownTimeout().
      Returns:
      the timeout.
    • getBackPressureMode

      BackPressureMode getBackPressureMode()
      Return the BackPressureMode for this container.
      Returns:
      the backpressure mode.
    • getListenerMode

      ListenerMode getListenerMode()
      Return the ListenerMode mode for this container.
      Returns:
      the listener mode.
    • getMessageConverter

      MessagingMessageConverter<?> getMessageConverter()
      Return the MessagingMessageConverter for this container.
      Returns:
      the message converter.
    • getAcknowledgementInterval

      @Nullable Duration getAcknowledgementInterval()
      Return the maximum interval between acknowledgements for batch acknowledgements.
      Returns:
      the interval.
    • getAcknowledgementThreshold

      @Nullable Integer getAcknowledgementThreshold()
      Return the threshold for triggering a batch acknowledgement.
      Returns:
      the threshold.
    • getAcknowledgementMode

      AcknowledgementMode getAcknowledgementMode()
      Return the AcknowledgementMode for this container.
      Returns:
      the acknowledgement mode.
    • getAcknowledgementOrdering

      @Nullable AcknowledgementOrdering getAcknowledgementOrdering()
      Return the AcknowledgementOrdering for this container.
      Returns:
      the acknowledgement ordering.
    • configure

      default O configure(ConfigurableContainerComponent configurable)
      Configure a ConfigurableContainerComponent with this options. Internal use mostly.
      Parameters:
      configurable - the component to be configured.
      Returns:
      this instance.
    • configure

      default O configure(Collection<? extends ConfigurableContainerComponent> configurables)
      Configure a collection of ConfigurableContainerComponent with this options. Internal use mostly.
      Parameters:
      configurables - the components to be configured.
      Returns:
      this instance.
    • createCopy

      default O createCopy()
      Create a copy of this options. Note that this does not copy complex objects and those will be shared between the original and the copy.
      Returns:
      a copy of this instance;
    • toBuilder

      B toBuilder()
      Returns:
      the new builder instance.