Package io.awspring.cloud.sqs.listener
Class AbstractContainerOptions.Builder<B extends ContainerOptionsBuilder<B,O>,O extends ContainerOptions<O,B>>
java.lang.Object
io.awspring.cloud.sqs.listener.AbstractContainerOptions.Builder<B,O>
- All Implemented Interfaces:
ContainerOptionsBuilder<B,
O>
- Enclosing class:
- AbstractContainerOptions<O extends ContainerOptions<O,
B>, B extends ContainerOptionsBuilder<B, O>>
protected abstract static class AbstractContainerOptions.Builder<B extends ContainerOptionsBuilder<B,O>,O extends ContainerOptions<O,B>>
extends Object
implements ContainerOptionsBuilder<B,O>
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Builder()
protected
Builder
(AbstractContainerOptions<?, ?> options) -
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.autoStartup
(boolean autoStartup) Set whether the container should be started automatically or manually.backPressureMode
(BackPressureMode backPressureMode) Set theBackPressureMode
for this container.componentsTaskExecutor
(TaskExecutor taskExecutor) Set theTaskExecutor
to be used by this container's components.listenerMode
(ListenerMode listenerMode) Set theListenerMode
mode for this container.listenerShutdownTimeout
(Duration listenerShutdownTimeout) 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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.awspring.cloud.sqs.listener.ContainerOptionsBuilder
build, createCopy, fromBuilder
-
Constructor Details
-
Builder
protected Builder() -
Builder
-
-
Method Details
-
maxConcurrentMessages
Description copied from interface:ContainerOptionsBuilder
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.- Specified by:
maxConcurrentMessages
in interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,
O>, O extends ContainerOptions<O, B>> - Returns:
- this instance.
-
maxMessagesPerPoll
Description copied from interface:ContainerOptionsBuilder
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.- Specified by:
maxMessagesPerPoll
in interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,
O>, O extends ContainerOptions<O, B>> - Parameters:
maxMessagesPerPoll
- the number of messages.- Returns:
- this instance.
-
autoStartup
Description copied from interface:ContainerOptionsBuilder
Set whether the container should be started automatically or manually. By default, the container is set to start automatically.- Specified by:
autoStartup
in interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,
O>, O extends ContainerOptions<O, B>> - Parameters:
autoStartup
- true if the container is set to start automatically, false if it should be started manually- Returns:
- this instance.
-
pollTimeout
Description copied from interface:ContainerOptionsBuilder
Set the timeout for polling messages for this endpoint. Default is 10 seconds.- Specified by:
pollTimeout
in interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,
O>, O extends ContainerOptions<O, B>> - Parameters:
pollTimeout
- the poll timeout.- Returns:
- this instance.
-
maxDelayBetweenPolls
Description copied from interface:ContainerOptionsBuilder
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.- Specified by:
maxDelayBetweenPolls
in interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,
O>, O extends ContainerOptions<O, B>> - Parameters:
maxDelayBetweenPolls
- the maximum delay.- Returns:
- this instance.
- See Also:
-
listenerMode
Description copied from interface:ContainerOptionsBuilder
Set theListenerMode
mode for this container. Default isListenerMode.SINGLE_MESSAGE
- Specified by:
listenerMode
in interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,
O>, O extends ContainerOptions<O, B>> - Parameters:
listenerMode
- the listener mode.- Returns:
- this instance.
-
componentsTaskExecutor
Description copied from interface:ContainerOptionsBuilder
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.- Specified by:
componentsTaskExecutor
in interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,
O>, O extends ContainerOptions<O, B>> - Parameters:
taskExecutor
- the task executor.- Returns:
- this instance.
- See Also:
-
acknowledgementResultTaskExecutor
Description copied from interface:ContainerOptionsBuilder
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.- Specified by:
acknowledgementResultTaskExecutor
in interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,
O>, O extends ContainerOptions<O, B>> - Parameters:
taskExecutor
- the task executor.- Returns:
- this instance.
-
listenerShutdownTimeout
Description copied from interface:ContainerOptionsBuilder
Set the maximum amount of time that the container should wait for tasks to finish before shutting down. Default is 10 seconds.- Specified by:
listenerShutdownTimeout
in interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,
O>, O extends ContainerOptions<O, B>> - Parameters:
listenerShutdownTimeout
- the timeout.- Returns:
- this instance.
-
acknowledgementShutdownTimeout
Description copied from interface:ContainerOptionsBuilder
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.- Specified by:
acknowledgementShutdownTimeout
in interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,
O>, O extends ContainerOptions<O, B>> - Returns:
- this instance.
-
backPressureMode
Description copied from interface:ContainerOptionsBuilder
Set theBackPressureMode
for this container. Default isBackPressureMode.AUTO
- Specified by:
backPressureMode
in interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,
O>, O extends ContainerOptions<O, B>> - Parameters:
backPressureMode
- the backpressure mode.- Returns:
- this instance.
-
acknowledgementInterval
Description copied from interface:ContainerOptionsBuilder
Set the maximum interval between acknowledgements for batch acknowledgements. The default depends on the specificContainerComponentFactory
implementation.- Specified by:
acknowledgementInterval
in interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,
O>, O extends ContainerOptions<O, B>> - Parameters:
acknowledgementInterval
- the interval.- Returns:
- this instance.
-
acknowledgementThreshold
Description copied from interface:ContainerOptionsBuilder
Set the threshold for triggering a batch acknowledgement. The default depends on the specificContainerComponentFactory
implementation.- Specified by:
acknowledgementThreshold
in interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,
O>, O extends ContainerOptions<O, B>> - Parameters:
acknowledgementThreshold
- the threshold.- Returns:
- this instance.
-
acknowledgementMode
Description copied from interface:ContainerOptionsBuilder
Set theAcknowledgementMode
for this container. Default isAcknowledgementMode.ON_SUCCESS
.- Specified by:
acknowledgementMode
in interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,
O>, O extends ContainerOptions<O, B>> - Parameters:
acknowledgementMode
- the acknowledgement mode.- Returns:
- this instance.
-
acknowledgementOrdering
Description copied from interface:ContainerOptionsBuilder
Set theAcknowledgementOrdering
for this container. Default isAcknowledgementOrdering.PARALLEL
.- Specified by:
acknowledgementOrdering
in interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,
O>, O extends ContainerOptions<O, B>> - Parameters:
acknowledgementOrdering
- the acknowledgement ordering.- Returns:
- this instance
-
messageConverter
Description copied from interface:ContainerOptionsBuilder
Set theMessagingMessageConverter
for this container.- Specified by:
messageConverter
in interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,
O>, O extends ContainerOptions<O, B>> - Parameters:
messageConverter
- the message converter.- Returns:
- this instance.
-