Package io.awspring.cloud.sqs.listener
Class AbstractContainerOptions<O extends ContainerOptions<O,B>,B extends ContainerOptionsBuilder<B,O>>
java.lang.Object
io.awspring.cloud.sqs.listener.AbstractContainerOptions<O,B>
- All Implemented Interfaces:
ContainerOptions<O,B>
- Direct Known Subclasses:
SqsContainerOptions
public abstract class AbstractContainerOptions<O extends ContainerOptions<O,B>,B extends ContainerOptionsBuilder<B,O>>
extends Object
implements ContainerOptions<O,B>
Base implementation for
ContainerOptions.- Since:
- 3.0
- Author:
- Tomaz Fernandes
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classAbstractContainerOptions.Builder<B extends ContainerOptionsBuilder<B,O>, O extends ContainerOptions<O, B>> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractContainerOptions(AbstractContainerOptions.Builder<?, ?> builder) -
Method Summary
Modifier and TypeMethodDescriptionReturn the maximum interval between acknowledgements for batch acknowledgements.Return theAcknowledgementModefor this container.Return theAcknowledgementOrderingfor this container.Return theTaskExecutorto be used by blockingAcknowledgementResultCallbackimplementations for this container.Return the maximum amount of time that the container should wait for batched acknowledgements to finish before shutting down.Return the threshold for triggering a batch acknowledgement.Return theBackPressureModefor this container.Return theTaskExecutorto be used by this container's components.Return theListenerModemode for this container.Return the maximum amount of time that the container should wait for processing tasks to finish before shutting down.intSet the maximum concurrent messages that can be processed simultaneously for each queue.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.intReturn the number of messages that should be returned per poll.Return theMessagingMessageConverterfor this container.org.springframework.retry.backoff.BackOffPolicyReturn theBackOffPolicyto be applied when polling throws an exception.Return the timeout for polling messages for this endpoint.booleanChecks whether the container should be started automatically or manually.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.ContainerOptions
configure, configure, createCopy, toBuilder
-
Constructor Details
-
AbstractContainerOptions
-
-
Method Details
-
getMaxConcurrentMessages
public int getMaxConcurrentMessages()Description copied from interface:ContainerOptionsSet 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.- Specified by:
getMaxConcurrentMessagesin interfaceContainerOptions<O extends ContainerOptions<O,B>, B extends ContainerOptionsBuilder<B, O>> - Returns:
- the maximum concurrent messages.
-
getMaxMessagesPerPoll
public int getMaxMessagesPerPoll()Description copied from interface:ContainerOptionsReturn the number of messages that should be returned per poll.- Specified by:
getMaxMessagesPerPollin interfaceContainerOptions<O extends ContainerOptions<O,B>, B extends ContainerOptionsBuilder<B, O>> - Returns:
- the maximum number of messages per poll.
-
isAutoStartup
public boolean isAutoStartup()Description copied from interface:ContainerOptionsChecks whether the container should be started automatically or manually. Default is true.- Specified by:
isAutoStartupin interfaceContainerOptions<O extends ContainerOptions<O,B>, B extends ContainerOptionsBuilder<B, O>> - Returns:
- true if the container starts automatically, false if it should be started manually
-
getPollTimeout
Description copied from interface:ContainerOptionsReturn the timeout for polling messages for this endpoint.- Specified by:
getPollTimeoutin interfaceContainerOptions<O extends ContainerOptions<O,B>, B extends ContainerOptionsBuilder<B, O>> - Returns:
- the timeout duration.
-
getPollBackOffPolicy
public org.springframework.retry.backoff.BackOffPolicy getPollBackOffPolicy()Description copied from interface:ContainerOptionsReturn theBackOffPolicyto be applied when polling throws an exception.- Specified by:
getPollBackOffPolicyin interfaceContainerOptions<O extends ContainerOptions<O,B>, B extends ContainerOptionsBuilder<B, O>> - Returns:
- the timeout duration.
-
getMaxDelayBetweenPolls
Description copied from interface:ContainerOptionsSet 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:
getMaxDelayBetweenPollsin interfaceContainerOptions<O extends ContainerOptions<O,B>, B extends ContainerOptionsBuilder<B, O>> - Returns:
- the maximum delay between polls.
- See Also:
-
getComponentsTaskExecutor
Description copied from interface:ContainerOptionsReturn 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:
getComponentsTaskExecutorin interfaceContainerOptions<O extends ContainerOptions<O,B>, B extends ContainerOptionsBuilder<B, O>> - Returns:
- the task executor.
-
getAcknowledgementResultTaskExecutor
Description copied from interface:ContainerOptionsReturn 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:
getAcknowledgementResultTaskExecutorin interfaceContainerOptions<O extends ContainerOptions<O,B>, B extends ContainerOptionsBuilder<B, O>> - Returns:
- the task executor.
-
getListenerShutdownTimeout
Description copied from interface:ContainerOptionsReturn 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 forContainerOptions.getAcknowledgementShutdownTimeout().- Specified by:
getListenerShutdownTimeoutin interfaceContainerOptions<O extends ContainerOptions<O,B>, B extends ContainerOptionsBuilder<B, O>> - Returns:
- the timeout.
-
getAcknowledgementShutdownTimeout
Description copied from interface:ContainerOptionsReturn 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 toContainerOptions.getListenerShutdownTimeout().- Specified by:
getAcknowledgementShutdownTimeoutin interfaceContainerOptions<O extends ContainerOptions<O,B>, B extends ContainerOptionsBuilder<B, O>> - Returns:
- the timeout.
-
getBackPressureMode
Description copied from interface:ContainerOptionsReturn theBackPressureModefor this container.- Specified by:
getBackPressureModein interfaceContainerOptions<O extends ContainerOptions<O,B>, B extends ContainerOptionsBuilder<B, O>> - Returns:
- the backpressure mode.
-
getListenerMode
Description copied from interface:ContainerOptionsReturn theListenerModemode for this container.- Specified by:
getListenerModein interfaceContainerOptions<O extends ContainerOptions<O,B>, B extends ContainerOptionsBuilder<B, O>> - Returns:
- the listener mode.
-
getMessageConverter
Description copied from interface:ContainerOptionsReturn theMessagingMessageConverterfor this container.- Specified by:
getMessageConverterin interfaceContainerOptions<O extends ContainerOptions<O,B>, B extends ContainerOptionsBuilder<B, O>> - Returns:
- the message converter.
-
getAcknowledgementInterval
Description copied from interface:ContainerOptionsReturn the maximum interval between acknowledgements for batch acknowledgements.- Specified by:
getAcknowledgementIntervalin interfaceContainerOptions<O extends ContainerOptions<O,B>, B extends ContainerOptionsBuilder<B, O>> - Returns:
- the interval.
-
getAcknowledgementThreshold
Description copied from interface:ContainerOptionsReturn the threshold for triggering a batch acknowledgement.- Specified by:
getAcknowledgementThresholdin interfaceContainerOptions<O extends ContainerOptions<O,B>, B extends ContainerOptionsBuilder<B, O>> - Returns:
- the threshold.
-
getAcknowledgementMode
Description copied from interface:ContainerOptionsReturn theAcknowledgementModefor this container.- Specified by:
getAcknowledgementModein interfaceContainerOptions<O extends ContainerOptions<O,B>, B extends ContainerOptionsBuilder<B, O>> - Returns:
- the acknowledgement mode.
-
getAcknowledgementOrdering
Description copied from interface:ContainerOptionsReturn theAcknowledgementOrderingfor this container.- Specified by:
getAcknowledgementOrderingin interfaceContainerOptions<O extends ContainerOptions<O,B>, B extends ContainerOptionsBuilder<B, O>> - Returns:
- the acknowledgement ordering.
-