public class QueueBufferConfig extends Object
Modifier and Type | Field and Description |
---|---|
static boolean |
ADAPTIVE_PREFETCHING_DEFAULT |
static int |
LONGPOLL_WAIT_TIMEOUT_SECONDS_DEFAULT |
static long |
MAX_BATCH_OPEN_MS_DEFAULT
200 milliseconds
|
static long |
MAX_BATCH_SIZE_BYTES_DEFAULT
256 kilobytes
|
static int |
MAX_BATCH_SIZE_DEFAULT |
static int |
MAX_DONE_RECEIVE_BATCHES_DEFAULT
10 batches
|
static int |
MAX_INFLIGHT_OUTBOUND_BATCHES_DEFAULT
5 batches
|
static int |
MAX_INFLIGHT_RECEIVE_BATCHES_DEFAULT
10 batches
|
static int |
MIN_RECEIVE_WAIT_TIME_MS_DEFAULT
50 ms, which is in the ballpark for typical latency contacting a remote service like SQS
|
static List<String> |
RECEIVE_ATTRIBUTE_NAMES_DEFAULT |
static List<String> |
RECEIVE_MESSAGE_ATTRIBUTE_NAMES_DEFAULT |
static long |
SERVICE_MAX_BATCH_SIZE_BYTES
Updated as the service now supports messages of size max 256 KiB.
|
static int |
VISIBILITY_TIMEOUT_SECONDS_DEFAULT
-1, which means use the visibility timeout of the queue
|
Constructor and Description |
---|
QueueBufferConfig() |
QueueBufferConfig(long maxBatchOpenMs,
int maxInflightOutboundBatches,
int maxInflightReceiveBatches,
int maxDoneReceiveBatches,
boolean paramLongPoll,
long maxBatchSizeBytes,
int visibilityTimeout,
int longPollTimeout,
int maxBatch) |
QueueBufferConfig(QueueBufferConfig other)
copy constructor
|
Modifier and Type | Method and Description |
---|---|
int |
getLongPollWaitTimeoutSeconds()
Specifies the amount of time, in seconds, the receive call will block on the server waiting
for messages to arrive if the queue is empty when the receive call is first made.
|
long |
getMaxBatchOpenMs()
The maximum time (milliseconds) a send batch is held open for additional outbound requests.
|
int |
getMaxBatchSize()
Specifies the maximum number of entries the buffered client will put in a single batch
request.
|
long |
getMaxBatchSizeBytes()
Maximum permitted size of a SendMessage or SendMessageBatch message, in bytes.
|
int |
getMaxDoneReceiveBatches()
If more than that number of completed receive batches are waiting in the buffer, the querying
for new messages will stop.
The larger this number, the more messages the queue buffer will pre-fetch and keep in the buffer on the client side, and the faster receive requests will be satisfied. |
int |
getMaxInflightOutboundBatches()
The maximum number of concurrent batches for each type of outbound request.
|
int |
getMaxInflightReceiveBatches()
The maximum number of concurrent receive message batches.
|
int |
getMinReceiveWaitTimeMs()
Configures the minimum wait time for incoming receive message requests.
|
List<String> |
getReceiveAttributeNames()
Specifies the attributes receive calls will request.
|
List<String> |
getReceiveMessageAttributeNames()
Specifies the message attributes receive calls will request.
|
int |
getVisibilityTimeoutSeconds()
Custom visibility timeout to use when retrieving messages from SQS.
|
boolean |
isAdapativePrefetching()
If set, prefetching will be scaled with the number of in-flight incoming receive requests
made to the client.
|
boolean |
isDeleteInBackground()
If set, even synchronous calls to delete messages will be made using background
asynchronous batches.
|
boolean |
isFlushOnShutdown()
Returns the flushOnShutdown value.
|
boolean |
isLongPoll() |
void |
setAdaptivePrefetching(boolean adaptivePrefetching)
If set, prefetching will be scaled with the number of in-flight incoming receive requests
made to the client.
|
void |
setDeleteInBackground(boolean deleteInBackground)
If set, even synchronous calls to delete messages will be made using background
asynchronous batches.
|
void |
setFlushOnShutdown(boolean flushOnShutdown)
Sets the flushOnShutdown option.
|
void |
setLongPoll(boolean longPoll)
Specify "true" for receive requests to use long polling.
|
void |
setLongPollWaitTimeoutSeconds(int longPollWaitTimeoutSeconds)
Specifies the amount of time, in seconds, the receive call will block on the server waiting
for messages to arrive if the queue is empty when the receive call is first made.
|
void |
setMaxBatchOpenMs(long maxBatchOpenMs)
The maximum time (milliseconds) a send batch is held open for additional outbound requests.
|
void |
setMaxBatchSize(int maxBatchSize)
Specifies the maximum number of entries the buffered client will put in a single batch
request.
|
void |
setMaxBatchSizeBytes(long maxBatchSizeBytes)
Maximum permitted size of a SendMessage or SendMessageBatch message, in bytes.
|
void |
setMaxDoneReceiveBatches(int maxDoneReceiveBatches)
If more than that number of completed receive batches are waiting in the buffer, the querying
for new messages will stop.
|
void |
setMaxInflightOutboundBatches(int maxInflightOutboundBatches)
The maximum number of concurrent batches for each type of outbound request.
|
void |
setMaxInflightReceiveBatches(int maxInflightReceiveBatches)
The maximum number of concurrent receive message batches.
|
void |
setMinReceiveWaitTimeMs(int minReceiveWaitTimeMs)
Configures the minimum wait time for incoming receive message requests.
|
void |
setReceiveAttributeNames(List<String> receiveAttributeNames)
Specifies the attributes receive calls will request.
|
void |
setReceiveMessageAttributeNames(List<String> receiveMessageAttributeNames)
Specifies the message attributes receive calls will request.
|
void |
setVisibilityTimeoutSeconds(int visibilityTimeoutSeconds)
Custom visibility timeout to use when retrieving messages from SQS.
|
String |
toString() |
QueueBufferConfig |
withAdapativePrefetching(boolean adaptivePrefetching)
If set, prefetching will be scaled with the number of in-flight incoming receive requests
made to the client.
|
QueueBufferConfig |
withDeleteInBackground(boolean deleteInBackground)
If set, even synchronous calls to delete messages will be made using background
asynchronous batches.
|
QueueBufferConfig |
withFlushOnShutdown(boolean flushOnShutdown)
Sets the flushOnShutdown option.
|
QueueBufferConfig |
withLongPoll(boolean longPoll)
Specify "true" for receive requests to use long polling.
|
QueueBufferConfig |
withLongPollWaitTimeoutSeconds(int longPollWaitTimeoutSeconds)
Specifies the amount of time, in seconds, the receive call will block on the server waiting
for messages to arrive if the queue is empty when the receive call is first made.
|
QueueBufferConfig |
withMaxBatchOpenMs(long maxBatchOpenMs)
The maximum time (milliseconds) a send batch is held open for additional outbound requests.
|
QueueBufferConfig |
withMaxBatchSize(int maxBatchSize)
Specifies the maximum number of entries the buffered client will put in a single batch
request.
|
QueueBufferConfig |
withMaxBatchSizeBytes(long maxBatchSizeBytes)
Maximum permitted size of a SendMessage or SendMessageBatch message, in bytes.
|
QueueBufferConfig |
withMaxDoneReceiveBatches(int maxDoneReceiveBatches)
If more than that number of completed receive batches are waiting in the buffer, the querying
for new messages will stop.
|
QueueBufferConfig |
withMaxInflightOutboundBatches(int maxInflightOutboundBatches)
The maximum number of concurrent batches for each type of outbound request.
|
QueueBufferConfig |
withMaxInflightReceiveBatches(int maxInflightReceiveBatches)
The maximum number of concurrent receive message batches.
|
QueueBufferConfig |
withMinReceiveWaitTimeMs(int minReceiveWaitTimeMs)
Configures the minimum wait time for incoming receive message requests.
|
QueueBufferConfig |
withReceiveAttributeNames(List<String> receiveAttributes)
Specifies the attributes receive calls will request.
|
QueueBufferConfig |
withReceiveMessageAttributeNames(List<String> receiveMessageAttributes)
Specifies the message attributes receive calls will request.
|
QueueBufferConfig |
withVisibilityTimeoutSeconds(int visibilityTimeoutSeconds)
Custom visibility timeout to use when retrieving messages from SQS.
|
public static final int MAX_BATCH_SIZE_DEFAULT
public static final long SERVICE_MAX_BATCH_SIZE_BYTES
public static final long MAX_BATCH_OPEN_MS_DEFAULT
public static final int MAX_INFLIGHT_OUTBOUND_BATCHES_DEFAULT
public static final int MAX_INFLIGHT_RECEIVE_BATCHES_DEFAULT
public static final int MAX_DONE_RECEIVE_BATCHES_DEFAULT
public static final long MAX_BATCH_SIZE_BYTES_DEFAULT
public static final int VISIBILITY_TIMEOUT_SECONDS_DEFAULT
public static final int LONGPOLL_WAIT_TIMEOUT_SECONDS_DEFAULT
public static final int MIN_RECEIVE_WAIT_TIME_MS_DEFAULT
public static final List<String> RECEIVE_MESSAGE_ATTRIBUTE_NAMES_DEFAULT
public static final boolean ADAPTIVE_PREFETCHING_DEFAULT
public QueueBufferConfig(long maxBatchOpenMs, int maxInflightOutboundBatches, int maxInflightReceiveBatches, int maxDoneReceiveBatches, boolean paramLongPoll, long maxBatchSizeBytes, int visibilityTimeout, int longPollTimeout, int maxBatch)
public QueueBufferConfig()
public QueueBufferConfig(QueueBufferConfig other)
public long getMaxBatchOpenMs()
public void setMaxBatchOpenMs(long maxBatchOpenMs)
public QueueBufferConfig withMaxBatchOpenMs(long maxBatchOpenMs)
public boolean isDeleteInBackground()
public void setDeleteInBackground(boolean deleteInBackground)
public QueueBufferConfig withDeleteInBackground(boolean deleteInBackground)
public boolean isLongPoll()
public void setLongPoll(boolean longPoll)
public QueueBufferConfig withLongPoll(boolean longPoll)
public int getMaxInflightOutboundBatches()
public void setMaxInflightOutboundBatches(int maxInflightOutboundBatches)
public QueueBufferConfig withMaxInflightOutboundBatches(int maxInflightOutboundBatches)
public int getMaxInflightReceiveBatches()
public void setMaxInflightReceiveBatches(int maxInflightReceiveBatches)
public QueueBufferConfig withMaxInflightReceiveBatches(int maxInflightReceiveBatches)
public int getMaxDoneReceiveBatches()
public void setMaxDoneReceiveBatches(int maxDoneReceiveBatches)
public QueueBufferConfig withMaxDoneReceiveBatches(int maxDoneReceiveBatches)
public long getMaxBatchSizeBytes()
public void setMaxBatchSizeBytes(long maxBatchSizeBytes)
IllegalArgumentException
- if the size being set is greater than the service allowed size for message body.public QueueBufferConfig withMaxBatchSizeBytes(long maxBatchSizeBytes)
IllegalArgumentException
- if the size being set is greater than the service allowed size for message body.public int getVisibilityTimeoutSeconds()
public void setVisibilityTimeoutSeconds(int visibilityTimeoutSeconds)
public QueueBufferConfig withVisibilityTimeoutSeconds(int visibilityTimeoutSeconds)
public void setLongPollWaitTimeoutSeconds(int longPollWaitTimeoutSeconds)
public int getLongPollWaitTimeoutSeconds()
public QueueBufferConfig withLongPollWaitTimeoutSeconds(int longPollWaitTimeoutSeconds)
public int getMinReceiveWaitTimeMs()
public void setMinReceiveWaitTimeMs(int minReceiveWaitTimeMs)
public QueueBufferConfig withMinReceiveWaitTimeMs(int minReceiveWaitTimeMs)
public int getMaxBatchSize()
public void setMaxBatchSize(int maxBatchSize)
public QueueBufferConfig withMaxBatchSize(int maxBatchSize)
public List<String> getReceiveAttributeNames()
The default value is an empty list, so any receive requests that require attributes will not be fulfilled from buffers.
public void setReceiveAttributeNames(List<String> receiveAttributeNames)
The default value is an empty list, so any receive requests that require attributes will not be fulfilled from buffers.
public QueueBufferConfig withReceiveAttributeNames(List<String> receiveAttributes)
The default value is an empty list, so any receive requests that require attributes will not be fulfilled from buffers.
public List<String> getReceiveMessageAttributeNames()
The default value is an empty list, so any receive requests that require message attributes will not be fulfilled from buffers.
public void setReceiveMessageAttributeNames(List<String> receiveMessageAttributeNames)
The default value is an empty list, so any receive requests that require message attributes will not be fulfilled from buffers.
public QueueBufferConfig withReceiveMessageAttributeNames(List<String> receiveMessageAttributes)
The default value is an empty list, so any receive requests that require message attributes will not be fulfilled from buffers.
public void setAdaptivePrefetching(boolean adaptivePrefetching)
public boolean isAdapativePrefetching()
public QueueBufferConfig withAdapativePrefetching(boolean adaptivePrefetching)
public boolean isFlushOnShutdown()
SendQueueBuffer
during shutdown.public void setFlushOnShutdown(boolean flushOnShutdown)
SendQueueBuffer
during shutdown.flushOnShutdown
- boolean value to configure flushOnShutdown.public QueueBufferConfig withFlushOnShutdown(boolean flushOnShutdown)
SendQueueBuffer
during shutdown.flushOnShutdown
- boolean value to configure flushOnShutdown.Copyright © 2024. All rights reserved.