@@ -220,7 +220,7 @@ public static void usageDemo() {
220220 System .out .println ("Welcome to the Amazon Simple Queue Service (Amazon SQS) demo!" );
221221 System .out .println ("-" .repeat (88 ));
222222
223- // Create a queue for the demo
223+ // Create a queue for the demo.
224224 String queueName = "sqs-usage-demo-message-wrapper-" +System .currentTimeMillis ();
225225 CreateQueueRequest createRequest = CreateQueueRequest .builder ()
226226 .queueName (queueName )
@@ -229,13 +229,13 @@ public static void usageDemo() {
229229 System .out .println ("Created queue: " + queueUrl );
230230
231231 try {
232- // Read the lines from this Java file
232+ // Read the lines from this Java file.
233233 Path projectRoot = Paths .get (System .getProperty ("user.dir" ));
234234 Path filePath = projectRoot .resolve ("src/main/java/com/example/sqs/SendRecvBatch.java" );
235235 List <String > lines = Files .readAllLines (filePath );
236236
237237
238- // Send file lines in batches
238+ // Send file lines in batches.
239239 int batchSize = 10 ;
240240 System .out .println ("Sending file lines in batches of " + batchSize + " as messages." );
241241
@@ -245,7 +245,7 @@ public static void usageDemo() {
245245 for (int j = i ; j < Math .min (i + batchSize , lines .size ()); j ++) {
246246 String line = lines .get (j );
247247 if (line == null || line .trim ().isEmpty ()) {
248- continue ; // Skip empty lines
248+ continue ; // Skip empty lines.
249249 }
250250
251251 Map <String , MessageAttributeValue > attributes = new HashMap <>();
@@ -268,7 +268,7 @@ public static void usageDemo() {
268268
269269 System .out .println ("\n Done. Sent " + lines .size () + " messages." );
270270
271- // Receive and process messages
271+ // Receive and process messages.
272272 System .out .println ("Receiving, handling, and deleting messages in batches of " + batchSize + "." );
273273 String [] receivedLines = new String [lines .size ()];
274274 boolean moreMessages = true ;
@@ -292,7 +292,7 @@ public static void usageDemo() {
292292
293293 System .out .println ("\n Done." );
294294
295- // Verify all lines were received correctly
295+ // Verify all lines were received correctly.
296296 boolean allLinesMatch = true ;
297297 for (int i = 0 ; i < lines .size (); i ++) {
298298 String originalLine = lines .get (i );
@@ -313,7 +313,7 @@ public static void usageDemo() {
313313 } catch (IOException e ) {
314314 logger .log (Level .SEVERE , "Error reading file" , e );
315315 } finally {
316- // Clean up by deleting the queue
316+ // Clean up by deleting the queue.
317317 DeleteQueueRequest deleteQueueRequest = DeleteQueueRequest .builder ()
318318 .queueUrl (queueUrl )
319319 .build ();
0 commit comments