Skip to content

Commit c177ef9

Browse files
committed
fix up3
1 parent 5a179f2 commit c177ef9

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

.doc_gen/metadata/sqs_metadata.yaml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -873,12 +873,29 @@ sqs_Scenario_SendReceiveBatch:
873873
github: javav2/example_code/sqs
874874
sdkguide:
875875
excerpts:
876-
- description: Compare single-message SQS operations with automatic batching.
877-
snippet_tags:
878-
- sqs.java2.batch_demo.main
879-
- description: Create functions to wrap &SQS; message functions and use them to send and receive messages in batches.
876+
- description: >-
877+
You can handle batch message operations with Amazon SQS using two different approaches
878+
with the &JavaV2long;:</para>
879+
<para><emphasis role="strong">SendRecvBatch.java</emphasis> uses explicit batch operations.
880+
You manually create message batches and call <code>sendMessageBatch()</code> and
881+
<code>deleteMessageBatch()</code> directly. You also handle batch responses, including any
882+
failed messages. This approach gives you full control over batch sizing and error handling.
883+
However, it requires more code to manage the batching logic.</para>
884+
<para><emphasis role="strong">SimpleProducerConsumer.java</emphasis> uses the high-level
885+
<code>SqsAsyncBatchManager</code> library for automatic request batching. You make
886+
individual <code>sendMessage()</code> and <code>deleteMessage()</code> calls with the same
887+
method signatures as the standard client. The SDK automatically buffers these calls and
888+
sends them as batch operations. This approach requires minimal code changes while providing
889+
batching performance benefits.</para>
890+
<para>Use explicit batching when you need fine-grained control over batch composition and
891+
error handling. Use automatic batching when you want to optimize performance with minimal
892+
code changes.</para>
893+
<para>Use explicit batch operations with messages.
880894
snippet_tags:
881895
- sqs.java2.sendRecvBatch.main
896+
- description: Use automatic batching of messages.
897+
snippet_tags:
898+
- sqs.java2.batch_demo.main
882899
services:
883900
sqs: {CreateQueue, DeleteQueue, SendMessageBatch, SendMessage, ReceiveMessage, DeleteMessageBatch, DeleteMessage}
884901
sqs_GetQueueAttributes:

0 commit comments

Comments
 (0)