Package io.atleon.aws.sqs
Class SqsSenderOptions.Builder
- java.lang.Object
-
- io.atleon.aws.sqs.SqsSenderOptions.Builder
-
- Enclosing class:
- SqsSenderOptions
public static final class SqsSenderOptions.Builder extends Object
A mutable builder used to construct new instances ofSqsSenderOptions.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SqsSenderOptions.BuilderbatchDuration(Duration batchDuration)When batching is enabled, this configures the maximum amount of time that will be waited for a batch to be filled before sending the batch.SqsSenderOptions.BuilderbatchPrefetch(int batchPrefetch)The number of batches to prefetch for sending.SqsSenderOptions.BuilderbatchSize(int batchSize)When sending multiple messages to SQS, this configures the batching size.SqsSenderOptionsbuild()Build a new instance ofSqsSenderOptionsfrom the currently set properties.SqsSenderOptions.BuildermaxRequestsInFlight(int maxRequestsInFlight)The maximum amount of concurrent SQS Send Requests that are allowed to be in flight per sent Publisher.
-
-
-
Method Detail
-
build
public SqsSenderOptions build()
Build a new instance ofSqsSenderOptionsfrom the currently set properties.
-
batchSize
public SqsSenderOptions.Builder batchSize(int batchSize)
When sending multiple messages to SQS, this configures the batching size. A batch size <= 1 effectively disables batching such that each Message is sent in its own Request. A batch size > 1 enables batching, and requires thatbatchDuration(Duration)also be set to a positive Duration.
-
batchDuration
public SqsSenderOptions.Builder batchDuration(Duration batchDuration)
When batching is enabled, this configures the maximum amount of time that will be waited for a batch to be filled before sending the batch. Must be positive when batching is enabled.
-
batchPrefetch
public SqsSenderOptions.Builder batchPrefetch(int batchPrefetch)
The number of batches to prefetch for sending. Should not typically need to be explicitly configured unless batching is enabled AND the max number of in-flight requests is greater than 1. Note that resulting upstream prefetch will be product of batchSize * batchPrefetch.
-
maxRequestsInFlight
public SqsSenderOptions.Builder maxRequestsInFlight(int maxRequestsInFlight)
The maximum amount of concurrent SQS Send Requests that are allowed to be in flight per sent Publisher. If batching is disabled, this is the maximum number of Messages in flight. If batching is enabled, this is the maximum number of batched requests in flight.
-
-