Package io.awspring.cloud.sqs.listener
Interface ContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,O>,O extends ContainerOptions<O,B>>
- Type Parameters:
B
- the concreteContainerOptionsBuilder
type.O
- the concreteContainerOptions
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 Summary
Modifier and TypeMethodDescriptionacknowledgementInterval
(Duration acknowledgementInterval) Set the maximum interval between acknowledgements for batch acknowledgements.acknowledgementMode
(AcknowledgementMode acknowledgementMode) Set theAcknowledgementMode
for this container.acknowledgementOrdering
(AcknowledgementOrdering acknowledgementOrdering) Set theAcknowledgementOrdering
for this container.acknowledgementResultTaskExecutor
(TaskExecutor taskExecutor) Set theTaskExecutor
to be used by blockingAcknowledgementResultCallback
implementations 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.backPressureMode
(BackPressureMode backPressureMode) Set theBackPressureMode
for this container.build()
Create theContainerOptions
instance.componentsTaskExecutor
(TaskExecutor taskExecutor) Set theTaskExecutor
to be used by this container's components.Create a copy of this builder.void
fromBuilder
(B builder) Copy the given builder settings to this builder.listenerMode
(ListenerMode listenerMode) Set theListenerMode
mode 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 theMessagingMessageConverter
for this container.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.BATCH
Default is 10.- Parameters:
maxMessagesPerPoll
- the number of messages.- 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.
-
listenerMode
Set theListenerMode
mode for this container. Default isListenerMode.SINGLE_MESSAGE
- Parameters:
listenerMode
- the listener mode.- Returns:
- this instance.
-
componentsTaskExecutor
Set theTaskExecutor
to be used by this container's components. It's shared by theMessageSink
and 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 theTaskExecutor
to be used by blockingAcknowledgementResultCallback
implementations 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 10 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. * @param acknowledgementShutdownTimeout the timeout.- Returns:
- this instance.
-
backPressureMode
Set theBackPressureMode
for 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 specificContainerComponentFactory
implementation.- Parameters:
acknowledgementInterval
- the interval.- Returns:
- this instance.
-
acknowledgementThreshold
Set the threshold for triggering a batch acknowledgement. The default depends on the specificContainerComponentFactory
implementation.- Parameters:
acknowledgementThreshold
- the threshold.- Returns:
- this instance.
-
acknowledgementMode
Set theAcknowledgementMode
for this container. Default isAcknowledgementMode.ON_SUCCESS
.- Parameters:
acknowledgementMode
- the acknowledgement mode.- Returns:
- this instance.
-
acknowledgementOrdering
Set theAcknowledgementOrdering
for this container. Default isAcknowledgementOrdering.PARALLEL
.- Parameters:
acknowledgementOrdering
- the acknowledgement ordering.- Returns:
- this instance
-
messageConverter
Set theMessagingMessageConverter
for this container.- Parameters:
messageConverter
- the message converter.- Returns:
- this instance.
-
build
O build()Create theContainerOptions
instance.- 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.
-