Interface SqsAsyncBatchManager
-
- All Superinterfaces:
AutoCloseable,SdkAutoCloseable
- All Known Implementing Classes:
DefaultSqsAsyncBatchManager
@SdkPublicApi public interface SqsAsyncBatchManager extends SdkAutoCloseable
Batch manager for implementing automatic batching with an SQS async client. Create an instance usingbuilder().This manager buffers client requests and sends them in batches to the service, enhancing efficiency by reducing the number of API requests. Requests are buffered until they reach a specified limit or a timeout occurs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceSqsAsyncBatchManager.Builder
-
Method Summary
-
Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
close
-
-
-
-
Method Detail
-
builder
static SqsAsyncBatchManager.Builder builder()
Creates a builder for configuring and creating anSqsAsyncBatchManager.- Returns:
- A new builder.
-
sendMessage
default CompletableFuture<SendMessageResponse> sendMessage(SendMessageRequest request)
Buffers and batchesSendMessageRequests, sending them as aSendMessageBatchRequest. Requests are grouped by queue URL and override configuration, and sent when the batch size or timeout is reached.- Parameters:
request- The SendMessageRequest to be buffered.- Returns:
- CompletableFuture of the corresponding
SendMessageResponse.
-
sendMessage
default CompletableFuture<SendMessageResponse> sendMessage(Consumer<SendMessageRequest.Builder> sendMessageRequest)
Buffers and batchesSendMessageRequests using aConsumerto configure the request, sending them as aSendMessageBatchRequest. Requests are grouped by queue URL and override configuration, and sent when the batch size or timeout is reached.- Parameters:
sendMessageRequest- AConsumerto configure the SendMessageRequest to be buffered.- Returns:
- CompletableFuture of the corresponding
SendMessageResponse.
-
deleteMessage
default CompletableFuture<DeleteMessageResponse> deleteMessage(DeleteMessageRequest request)
Buffers and batchesDeleteMessageRequests, sending them as aDeleteMessageBatchRequest. Requests are grouped by queue URL and override configuration, and sent when the batch size or timeout is reached.- Parameters:
request- The DeleteMessageRequest to be buffered.- Returns:
- CompletableFuture of the corresponding
DeleteMessageResponse.
-
deleteMessage
default CompletableFuture<DeleteMessageResponse> deleteMessage(Consumer<DeleteMessageRequest.Builder> request)
Buffers and batchesDeleteMessageRequests using aConsumerto configure the request, sending them as aDeleteMessageBatchRequest. Requests are grouped by queue URL and override configuration, and sent when the batch size or timeout is reached.- Parameters:
request- AConsumerto configure the DeleteMessageRequest to be buffered.- Returns:
- CompletableFuture of the corresponding
DeleteMessageResponse.
-
changeMessageVisibility
default CompletableFuture<ChangeMessageVisibilityResponse> changeMessageVisibility(ChangeMessageVisibilityRequest request)
Buffers and batchesChangeMessageVisibilityRequests, sending them as aChangeMessageVisibilityBatchRequest. Requests are grouped by queue URL and override configuration, and sent when the batch size or timeout is reached.- Parameters:
request- The ChangeMessageVisibilityRequest to be buffered.- Returns:
- CompletableFuture of the corresponding
ChangeMessageVisibilityResponse.
-
changeMessageVisibility
default CompletableFuture<ChangeMessageVisibilityResponse> changeMessageVisibility(Consumer<ChangeMessageVisibilityRequest.Builder> request)
Buffers and batchesChangeMessageVisibilityRequests using aConsumerto configure the request, sending them as aChangeMessageVisibilityBatchRequest. Requests are grouped by queue URL and override configuration, and sent when the batch size or timeout is reached.- Parameters:
request- AConsumerto configure the ChangeMessageVisibilityRequest to be buffered.- Returns:
- CompletableFuture of the corresponding
ChangeMessageVisibilityResponse.
-
receiveMessage
default CompletableFuture<ReceiveMessageResponse> receiveMessage(ReceiveMessageRequest request)
Buffers and retrieves messages withReceiveMessageRequest, with a maximum of 10 messages per request. Returns an empty message if no messages are available in SQS.- Parameters:
request- The ReceiveMessageRequest.- Returns:
- CompletableFuture of the corresponding
ReceiveMessageResponse.
-
receiveMessage
default CompletableFuture<ReceiveMessageResponse> receiveMessage(Consumer<ReceiveMessageRequest.Builder> request)
Buffers and retrieves messages withReceiveMessageRequestusing aConsumerto configure the request, with a maximum of 10 messages per request. Returns an empty message if no messages are available in SQS.- Parameters:
request- AConsumerto configure the ReceiveMessageRequest.- Returns:
- CompletableFuture of the corresponding
ReceiveMessageResponse.
-
-