Package io.atleon.aws.sqs
Class SqsReceiverOptions.Builder
- java.lang.Object
-
- io.atleon.aws.sqs.SqsReceiverOptions.Builder
-
- Enclosing class:
- SqsReceiverOptions
public static final class SqsReceiverOptions.Builder extends Object
A mutable builder used to construct new instances ofSqsReceiverOptions.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SqsReceiverOptionsbuild()Build a new instance ofSqsReceiverOptionsfrom the currently set properties.SqsReceiverOptions.BuildercloseTimeout(Duration closeTimeout)When a subscription to SQS Messages is terminated, this is the amount of time that will be waited for in-flight Requests to be completed and in-flight Messages to be made visible again.SqsReceiverOptions.BuilderdeleteBatchSize(int deleteBatchSize)When deleting messages from SQS, this configures the batching size.SqsReceiverOptions.BuilderdeleteInterval(Duration deleteInterval)When delete batching is enabled, this configures the maximum amount of time that will be waited for a batch to be filled before executing the batch.SqsReceiverOptions.BuildermaxInFlightPerSubscription(int maxInFlightPerSubscription)The maximum number of Messages that haven't been deleted or marked as no longer in flight per subscription.SqsReceiverOptions.BuildermaxMessagesPerReception(int maxMessagesPerReception)The maximum number of Messages to request in each SQS Receive Message RequestSqsReceiverOptions.BuildermessageAttributesToRequest(Set<String> messageAttributesToRequest)The Message Attributes to request from SQS, which, when available, will be populated onReceivedSqsMessages.SqsReceiverOptions.BuildermessageSystemAttributesToRequest(Set<String> messageSystemAttributesToRequest)The Message System Attributes to request from SQS, which, when available, will be populated onReceivedSqsMessages.SqsReceiverOptions.BuildervisibilityTimeoutSeconds(int visibilityTimeoutSeconds)For each message received from SQS, this is the initial amount of seconds that the message will be invisible to other Receive Requests.SqsReceiverOptions.BuilderwaitTimeSecondsPerReception(int waitTimeSecondsPerReception)The wait time in seconds for each SQS Receive Request.
-
-
-
Method Detail
-
build
public SqsReceiverOptions build()
Build a new instance ofSqsReceiverOptionsfrom the currently set properties.
-
maxMessagesPerReception
public SqsReceiverOptions.Builder maxMessagesPerReception(int maxMessagesPerReception)
The maximum number of Messages to request in each SQS Receive Message Request
-
messageAttributesToRequest
public SqsReceiverOptions.Builder messageAttributesToRequest(Set<String> messageAttributesToRequest)
The Message Attributes to request from SQS, which, when available, will be populated onReceivedSqsMessages.
-
messageSystemAttributesToRequest
public SqsReceiverOptions.Builder messageSystemAttributesToRequest(Set<String> messageSystemAttributesToRequest)
The Message System Attributes to request from SQS, which, when available, will be populated onReceivedSqsMessages. The available set of Attributes are documented inMessageSystemAttributeName.
-
waitTimeSecondsPerReception
public SqsReceiverOptions.Builder waitTimeSecondsPerReception(int waitTimeSecondsPerReception)
The wait time in seconds for each SQS Receive Request. Any positive value activates "long polling".
-
visibilityTimeoutSeconds
public SqsReceiverOptions.Builder visibilityTimeoutSeconds(int visibilityTimeoutSeconds)
For each message received from SQS, this is the initial amount of seconds that the message will be invisible to other Receive Requests. If any given Message is not deleted nor has its visibility reset to a positive number of seconds before this amount of seconds elapses, then the Message may be received again, and the Message's original receipt handle will be no longer be valid.
-
maxInFlightPerSubscription
public SqsReceiverOptions.Builder maxInFlightPerSubscription(int maxInFlightPerSubscription)
The maximum number of Messages that haven't been deleted or marked as no longer in flight per subscription.
-
deleteBatchSize
public SqsReceiverOptions.Builder deleteBatchSize(int deleteBatchSize)
When deleting messages from SQS, this configures the batching size. A batch size <= 1 effectively disables batching such that each Message is deleted in its own Request. A batch size > 1 enables batching, and requires thatSqsReceiverOptions.deleteInterval()also be set to a positive Duration.
-
deleteInterval
public SqsReceiverOptions.Builder deleteInterval(Duration deleteInterval)
When delete batching is enabled, this configures the maximum amount of time that will be waited for a batch to be filled before executing the batch. Must be positive when batch deleting is enabled.
-
closeTimeout
public SqsReceiverOptions.Builder closeTimeout(Duration closeTimeout)
When a subscription to SQS Messages is terminated, this is the amount of time that will be waited for in-flight Requests to be completed and in-flight Messages to be made visible again.
-
-