Skip to content

Commit cd82691

Browse files
16lim21Michael Lizoewangg
authored
Renaming batch-utilities to batch-manager in docs, updating code snippets in design doc to reflect new decisions (#2639)
Co-authored-by: Michael Li <mchlia@amazon.com> Co-authored-by: Zoe Wang <33073555+zoewangg@users.noreply.github.com>
1 parent 9c823a5 commit cd82691

File tree

2 files changed

+21
-32
lines changed

2 files changed

+21
-32
lines changed

docs/design/core/batch-utilities/Design.md renamed to docs/design/core/batch-manager/Design.md

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,16 @@ For each service that can leverage batch features, two classes will be created:
105105
public interface SqsBatchManager {
106106
107107
/**
108-
* Buffers a variable number of messages on the client and sends them
109-
* as batch requests to the service.
108+
* Buffers outgoing requests on the client and sends them as batch requests to the service.
109+
* Requests are batched together according to a batchKey and are sent periodically to the
110+
* service as determined by {@link #maxBatchOpenInMs}. If the number of requests for a
111+
* batchKey reaches or exceeds {@link #maxBatchItems}, then the requests are immediately
112+
* flushed and the timeout on the periodic flush is reset.
113+
* By default, messages are batched according to a service's maximum size for a batch request.
114+
* These settings can be customized via the configuration.
110115
*
111-
* If the number of messages passed in is greater than the maximum size of
112-
* a batch request, the method also automatically chunks the messages into
113-
* the appropriate batch sizes before sending them with batch requests.
114-
* By default, messages are chunked according to a service's maximum size for a
115-
* batch request. These settings can be customized via the configuration.
116-
*
117-
* @param messages A variable number of SendMessageRequest items that represent
118-
the messages to be passed to SQS.
119-
* @return {@link BatchResponses}
116+
* @param request the outgoing request.
117+
* @return a CompletableFuture of the corresponding response.
120118
*/
121119
CompletableFuture<SendMessageResponse> sendMessage(SendMessageRequest message);
122120
@@ -126,7 +124,6 @@ For each service that can leverage batch features, two classes will be created:
126124
*/
127125
CompletableFuture<Void> flush();
128126
129-
130127
// Other Batch Manager methods omitted
131128
// ...
132129
@@ -170,35 +167,27 @@ For each service that can leverage batch features, two classes will be created:
170167
public interface SqsAsyncBatchManager {
171168
172169
/**
173-
* Buffers a variable number of messages on the client and sends them
174-
* as batch requests to the service.
170+
* Buffers outgoing requests on the client and sends them as batch requests to the service.
171+
* Requests are batched together according to a batchKey and are sent periodically to the
172+
* service as determined by {@link #maxBatchOpenInMs}. If the number of requests for a
173+
* batchKey reaches or exceeds {@link #maxBatchItems}, then the requests are immediately
174+
* flushed and the timeout on the periodic flush is reset.
175+
* By default, messages are batched according to a service's maximum size for a batch request.
176+
* These settings can be customized via the configuration.
175177
*
176-
* If the number of messages passed in is greater than the maximum size of
177-
* a batch request, the method also automatically chunks the messages into
178-
* the appropriate batch sizes before sending them with batch requests.
179-
* By default, messages are chunked according to a service's maximum size for a
180-
* batch request. These settings can be customized via the configuration.
181-
*
182-
* @param messages A variable number of SendMessageRequest items that represent
183-
the messages to be passed to SQS.
184-
* @return {@link BatchResponses}
178+
* @param request the outgoing request.
179+
* @return a CompletableFuture of the corresponding response.
185180
*/
186-
CompletableFuture<SendMessageResponse> sendMessage(SendMessageRequest messages);
181+
CompletableFuture<SendMessageResponse> sendMessage(SendMessageRequest message);
187182
188183
/**
189184
* Manually flush the buffer for sendMessage requests. Completes when requests
190185
* are sent. An exception is returned otherwise.
191186
*/
192187
CompletableFuture<Void> flush();
193188
194-
/**
195-
* Option to flush a specific buffer/queue
196-
* Buffer: DeleteMessage buffer, sendMessage buffer, ...
197-
* Queue: User would provide queueUrl
198-
* Note: The option to flush a specific buffer is not implemented in v1 nor
199-
* has it been requested.
200-
*/
201-
CompletableFuture<Void> flush(String bufferOrQueueName);
189+
// Other Batch Manager methods omitted
190+
// ...
202191
203192
interface Builder {
204193

0 commit comments

Comments
 (0)