Package io.awspring.cloud.sqs.listener
Interface ContainerOptions<O extends ContainerOptions<O,B>,B extends ContainerOptionsBuilder<B,O>>
- All Known Implementing Classes:
AbstractContainerOptions,SqsContainerOptions
public interface ContainerOptions<O extends ContainerOptions<O,B>,B extends ContainerOptionsBuilder<B,O>>
Contains the options to be used by the
MessageListenerContainer at runtime. Note that after the object has
been built by the ContainerOptionsBuilder it's immutable and thread-safe. If a new
ContainerOptionsBuilder is created from this object, any changes on it won't reflect on the original
instance. Also note that any copies are shallow, meaning that complex objects are not copied but shared between the
original instance and the copy.- Since:
- 3.0
- Author:
- Tomaz Fernandes
-
Method Summary
Modifier and TypeMethodDescriptiondefault Oconfigure(ConfigurableContainerComponent configurable) Configure aConfigurableContainerComponentwith this options.default Oconfigure(Collection<? extends ConfigurableContainerComponent> configurables) Configure a collection ofConfigurableContainerComponentwith this options.default OCreate a copy of this options.Return 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.default 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.
-
Method Details
-
getMaxConcurrentMessages
int getMaxConcurrentMessages()Set 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.- Returns:
- the maximum concurrent messages.
-
getMaxMessagesPerPoll
int getMaxMessagesPerPoll()Return the number of messages that should be returned per poll.- Returns:
- the maximum number of messages per poll.
-
isAutoStartup
boolean isAutoStartup()Checks whether the container should be started automatically or manually. Default is true.- Returns:
- true if the container starts automatically, false if it should be started manually
-
getMaxDelayBetweenPolls
Duration getMaxDelayBetweenPolls()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.- Returns:
- the maximum delay between polls.
- See Also:
-
getPollTimeout
Duration getPollTimeout()Return the timeout for polling messages for this endpoint.- Returns:
- the timeout duration.
-
getPollBackOffPolicy
default org.springframework.retry.backoff.BackOffPolicy getPollBackOffPolicy()Return theBackOffPolicyto be applied when polling throws an exception.- Returns:
- the timeout duration.
- Since:
- 3.2
-
getComponentsTaskExecutor
Return 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.- Returns:
- the task executor.
-
getAcknowledgementResultTaskExecutor
Return 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.- Returns:
- the task executor.
-
getListenerShutdownTimeout
Duration getListenerShutdownTimeout()Return 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 forgetAcknowledgementShutdownTimeout().- Returns:
- the timeout.
-
getAcknowledgementShutdownTimeout
Duration getAcknowledgementShutdownTimeout()Return 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 togetListenerShutdownTimeout().- Returns:
- the timeout.
-
getBackPressureMode
BackPressureMode getBackPressureMode()Return theBackPressureModefor this container.- Returns:
- the backpressure mode.
-
getListenerMode
ListenerMode getListenerMode()Return theListenerModemode for this container.- Returns:
- the listener mode.
-
getMessageConverter
MessagingMessageConverter<?> getMessageConverter()Return theMessagingMessageConverterfor this container.- Returns:
- the message converter.
-
getAcknowledgementInterval
Return the maximum interval between acknowledgements for batch acknowledgements.- Returns:
- the interval.
-
getAcknowledgementThreshold
Return the threshold for triggering a batch acknowledgement.- Returns:
- the threshold.
-
getAcknowledgementMode
AcknowledgementMode getAcknowledgementMode()Return theAcknowledgementModefor this container.- Returns:
- the acknowledgement mode.
-
getAcknowledgementOrdering
Return theAcknowledgementOrderingfor this container.- Returns:
- the acknowledgement ordering.
-
configure
Configure aConfigurableContainerComponentwith this options. Internal use mostly.- Parameters:
configurable- the component to be configured.- Returns:
- this instance.
-
configure
Configure a collection ofConfigurableContainerComponentwith this options. Internal use mostly.- Parameters:
configurables- the components to be configured.- Returns:
- this instance.
-
createCopy
Create a copy of this options. Note that this does not copy complex objects and those will be shared between the original and the copy.- Returns:
- a copy of this instance;
-
toBuilder
B toBuilder()Creates a new) instance configured with this options. Note that any changes made to the builder will have no effect on this object.- Returns:
- the new builder instance.
-