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
ConstructorsModifierConstructorDescriptionprotectedBuilder()protectedBuilder(AbstractContainerOptions<?, ?> options) -
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.componentsTaskExecutor(TaskExecutor taskExecutor) Set theTaskExecutorto be used by this container's components.listenerMode(ListenerMode listenerMode) Set theListenerModemode 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 theMessagingMessageConverterfor this container.pollBackOffPolicy(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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:ContainerOptionsBuilderSet 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:
maxConcurrentMessagesin interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,O>, O extends ContainerOptions<O, B>> - Returns:
- this instance.
-
maxMessagesPerPoll
Description copied from interface:ContainerOptionsBuilderSet 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.- Specified by:
maxMessagesPerPollin 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:ContainerOptionsBuilderSet whether the container should be started automatically or manually. By default, the container is set to start automatically.- Specified by:
autoStartupin 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:ContainerOptionsBuilderSet the timeout for polling messages for this endpoint. Default is 10 seconds.- Specified by:
pollTimeoutin interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,O>, O extends ContainerOptions<O, B>> - Parameters:
pollTimeout- the poll timeout.- Returns:
- this instance.
-
pollBackOffPolicy
Description copied from interface:ContainerOptionsBuilderSet theBackOffPolicyto use when polling throws an exception.- Specified by:
pollBackOffPolicyin interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,O>, O extends ContainerOptions<O, B>> - Parameters:
pollBackOffPolicy- the back off policy.- Returns:
- this instance.
-
maxDelayBetweenPolls
Description copied from interface:ContainerOptionsBuilderSet 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:
maxDelayBetweenPollsin 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:ContainerOptionsBuilderSet theListenerModemode for this container. Default isListenerMode.SINGLE_MESSAGE- Specified by:
listenerModein interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,O>, O extends ContainerOptions<O, B>> - Parameters:
listenerMode- the listener mode.- Returns:
- this instance.
-
componentsTaskExecutor
Description copied from interface:ContainerOptionsBuilderSet 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.- Specified by:
componentsTaskExecutorin 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:ContainerOptionsBuilderSet 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.- Specified by:
acknowledgementResultTaskExecutorin interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,O>, O extends ContainerOptions<O, B>> - Parameters:
taskExecutor- the task executor.- Returns:
- this instance.
-
listenerShutdownTimeout
Description copied from interface:ContainerOptionsBuilderSet the maximum amount of time that the container should wait for tasks to finish before shutting down. Default is 20 seconds.- Specified by:
listenerShutdownTimeoutin interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,O>, O extends ContainerOptions<O, B>> - Parameters:
listenerShutdownTimeout- the timeout.- Returns:
- this instance.
-
acknowledgementShutdownTimeout
Description copied from interface:ContainerOptionsBuilderSet 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.- Specified by:
acknowledgementShutdownTimeoutin interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,O>, O extends ContainerOptions<O, B>> - Parameters:
acknowledgementShutdownTimeout- the timeout.- Returns:
- this instance.
-
backPressureMode
Description copied from interface:ContainerOptionsBuilderSet theBackPressureModefor this container. Default isBackPressureMode.AUTO- Specified by:
backPressureModein interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,O>, O extends ContainerOptions<O, B>> - Parameters:
backPressureMode- the backpressure mode.- Returns:
- this instance.
-
acknowledgementInterval
Description copied from interface:ContainerOptionsBuilderSet the maximum interval between acknowledgements for batch acknowledgements. The default depends on the specificContainerComponentFactoryimplementation.- Specified by:
acknowledgementIntervalin interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,O>, O extends ContainerOptions<O, B>> - Parameters:
acknowledgementInterval- the interval.- Returns:
- this instance.
-
acknowledgementThreshold
Description copied from interface:ContainerOptionsBuilderSet the threshold for triggering a batch acknowledgement. The default depends on the specificContainerComponentFactoryimplementation.- Specified by:
acknowledgementThresholdin interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,O>, O extends ContainerOptions<O, B>> - Parameters:
acknowledgementThreshold- the threshold.- Returns:
- this instance.
-
acknowledgementMode
Description copied from interface:ContainerOptionsBuilderSet theAcknowledgementModefor this container. Default isAcknowledgementMode.ON_SUCCESS.- Specified by:
acknowledgementModein interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,O>, O extends ContainerOptions<O, B>> - Parameters:
acknowledgementMode- the acknowledgement mode.- Returns:
- this instance.
-
acknowledgementOrdering
Description copied from interface:ContainerOptionsBuilderSet theAcknowledgementOrderingfor this container. Default isAcknowledgementOrdering.PARALLEL.- Specified by:
acknowledgementOrderingin interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,O>, O extends ContainerOptions<O, B>> - Parameters:
acknowledgementOrdering- the acknowledgement ordering.- Returns:
- this instance
-
messageConverter
Description copied from interface:ContainerOptionsBuilderSet theMessagingMessageConverterfor this container.- Specified by:
messageConverterin interfaceContainerOptionsBuilder<B extends ContainerOptionsBuilder<B,O>, O extends ContainerOptions<O, B>> - Parameters:
messageConverter- the message converter.- Returns:
- this instance.
-