Skip to content

Commit

Permalink
Java SQS: move snippet tags
Browse files Browse the repository at this point in the history
Java cloudfront: add missing </para> tag
  • Loading branch information
tkhill-AWS authored and ford-at-aws committed Feb 23, 2024
1 parent 003f764 commit 858269b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .doc_gen/metadata/cloudfront_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ cloudfront_CreateDistribution:
sdkguide:
excerpts:
- description: >-
The following example uses an &S3long; (&S3;) bucket as a content origin.
The following example uses an &S3long; (&S3;) bucket as a content origin.</para>
<para>After creating the distribution,
the code creates a <ulink url="https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/cloudfront/waiters/CloudFrontWaiter.html">CloudFrontWaiter</ulink>
to wait until the distribution is deployed before returning the distribution</para>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ public static String createQueue(SqsClient sqsClient, String queueName) {
GetQueueUrlResponse getQueueUrlResponse = sqsClient
.getQueueUrl(GetQueueUrlRequest.builder().queueName(queueName).build());
return getQueueUrlResponse.queueUrl();
// snippet-end:[sqs.java2.sqs_example.get_queue]

} catch (SqsException e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
return "";
// snippet-end:[sqs.java2.sqs_example.get_queue]
}

public static void listQueues(SqsClient sqsClient) {
Expand Down Expand Up @@ -148,8 +148,8 @@ public static void sendBatchMessages(SqsClient sqsClient, String queueUrl) {
public static List<Message> receiveMessages(SqsClient sqsClient, String queueUrl) {

System.out.println("\nReceive messages");
// snippet-start:[sqs.java2.sqs_example.retrieve_messages]
try {
// snippet-start:[sqs.java2.sqs_example.retrieve_messages]
ReceiveMessageRequest receiveMessageRequest = ReceiveMessageRequest.builder()
.queueUrl(queueUrl)
.maxNumberOfMessages(5)
Expand Down Expand Up @@ -186,8 +186,8 @@ public static void changeMessages(SqsClient sqsClient, String queueUrl, List<Mes

public static void deleteMessages(SqsClient sqsClient, String queueUrl, List<Message> messages) {
System.out.println("\nDelete Messages");
// snippet-start:[sqs.java2.sqs_example.delete_message]

// snippet-start:[sqs.java2.sqs_example.delete_message]
try {
for (Message message : messages) {
DeleteMessageRequest deleteMessageRequest = DeleteMessageRequest.builder()
Expand All @@ -196,12 +196,11 @@ public static void deleteMessages(SqsClient sqsClient, String queueUrl, List<Mes
.build();
sqsClient.deleteMessage(deleteMessageRequest);
}
// snippet-end:[sqs.java2.sqs_example.delete_message]

} catch (SqsException e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
// snippet-end:[sqs.java2.sqs_example.delete_message]
}
}
// snippet-end:[sqs.java2.sqs_example.main]

0 comments on commit 858269b

Please sign in to comment.