Package io.awspring.cloud.sqs.listener
Interface ContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,O>,O extends ContainerOptions<O,B>>
- Type Parameters:
B- the concreteContainerOptionsBuildertype.O- the concreteContainerOptionstype.
- 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 Summary
Modifier and TypeMethodDescriptionacknowledgementInterval(Duration acknowledgementInterval) Set the maximum interval between acknowledgements for batch acknowledgements.acknowledgementMode(AcknowledgementMode acknowledgementMode) Set theAcknowledgementModefor this container.acknowledgementOrdering(AcknowledgementOrdering acknowledgementOrdering) Set theAcknowledgementOrderingfor this container.acknowledgementResultTaskExecutor(TaskExecutor taskExecutor) Set theTaskExecutorto be used by blockingAcknowledgementResultCallbackimplementations for this container.acknowledgementShutdownTimeout(Duration acknowledgementShutdownTimeout) Set the maximum amount of time that the container should wait for batched acknowledgements to finish before shutting down.acknowledgementThreshold(int acknowledgementThreshold) Set the threshold for triggering a batch acknowledgement.autoStartup(boolean autoStartup) Set whether the container should be started automatically or manually.backPressureMode(BackPressureMode backPressureMode) Set theBackPressureModefor this container.build()Create theContainerOptionsinstance.componentsTaskExecutor(TaskExecutor taskExecutor) Set theTaskExecutorto be used by this container's components.Create a copy of this builder.voidfromBuilder(B builder) Copy the given builder settings to this builder.listenerMode(ListenerMode listenerMode) Set theListenerModemode for this container.listenerShutdownTimeout(Duration shutdownTimeout) Set the maximum amount of time that the container should wait for tasks to finish before shutting down.maxConcurrentMessages(int maxConcurrentMessages) Set the maximum concurrent messages that can be processed simultaneously for each queue.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.maxMessagesPerPoll(int maxMessagesPerPoll) Set the number of messages that should be returned per poll.messageConverter(MessagingMessageConverter<?> messageConverter) Set theMessagingMessageConverterfor this container.default BpollBackOffPolicy(org.springframework.retry.backoff.BackOffPolicy pollBackOffPolicy) Set theBackOffPolicyto use when polling throws an exception.pollTimeout(Duration pollTimeout) Set the timeout for polling messages for this endpoint.
-
Method Details
-
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
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 forListenerMode.BATCHDefault is 10.- Parameters:
maxMessagesPerPoll- the number of messages.- Returns:
- this instance.
-
autoStartup
Set whether the container should be started automatically or manually. By default, the container is set to start automatically.- Parameters:
autoStartup- true if the container is set to start automatically, false if it should be started manually- Returns:
- this instance.
-
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
Set the timeout for polling messages for this endpoint. Default is 10 seconds.- Parameters:
pollTimeout- the poll timeout.- Returns:
- this instance.
-
pollBackOffPolicy
Set theBackOffPolicyto use when polling throws an exception.- Parameters:
pollBackOffPolicy- the back off policy.- Returns:
- this instance.
- Since:
- 3.2
-
listenerMode
Set theListenerModemode for this container. Default isListenerMode.SINGLE_MESSAGE- Parameters:
listenerMode- the listener mode.- Returns:
- this instance.
-
componentsTaskExecutor
Set theTaskExecutorto be used by this container's components. It's shared by theMessageSinkand any blocking components the container might have. Due to performance concerns, the provided executor MUST have aMessageExecutionThreadFactory. 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
Set theTaskExecutorto be used by blockingAcknowledgementResultCallbackimplementations for this container. Due to performance concerns, the provided executor MUST have aMessageExecutionThreadFactory. 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
Set the maximum amount of time that the container should wait for tasks to finish before shutting down. Default is 20 seconds.- Parameters:
shutdownTimeout- the timeout.- Returns:
- this instance.
-
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.- Parameters:
acknowledgementShutdownTimeout- the timeout.- Returns:
- this instance.
-
backPressureMode
Set theBackPressureModefor this container. Default isBackPressureMode.AUTO- Parameters:
backPressureMode- the backpressure mode.- Returns:
- this instance.
-
acknowledgementInterval
Set the maximum interval between acknowledgements for batch acknowledgements. The default depends on the specificContainerComponentFactoryimplementation.- Parameters:
acknowledgementInterval- the interval.- Returns:
- this instance.
-
acknowledgementThreshold
Set the threshold for triggering a batch acknowledgement. The default depends on the specificContainerComponentFactoryimplementation.- Parameters:
acknowledgementThreshold- the threshold.- Returns:
- this instance.
-
acknowledgementMode
Set theAcknowledgementModefor this container. Default isAcknowledgementMode.ON_SUCCESS.- Parameters:
acknowledgementMode- the acknowledgement mode.- Returns:
- this instance.
-
acknowledgementOrdering
Set theAcknowledgementOrderingfor this container. Default isAcknowledgementOrdering.PARALLEL.- Parameters:
acknowledgementOrdering- the acknowledgement ordering.- Returns:
- this instance
-
messageConverter
Set theMessagingMessageConverterfor this container.- Parameters:
messageConverter- the message converter.- Returns:
- this instance.
-
build
O build()Create theContainerOptionsinstance.- Returns:
- the new instance.
-
createCopy
B createCopy()Create a copy of this builder.- Returns:
- the copy.
-
fromBuilder
Copy the given builder settings to this builder.- Parameters:
builder- the builder from which to copy settings from.
-