Skip to content

Java V2: Added the follow for sending and receiving messages in batches for SQS #7508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tejasgn1
Copy link
Contributor

@tejasgn1 tejasgn1 commented Jul 1, 2025

This PR handles the Java follow for sending and receiving messages in batches for Amazon SQS.

CDD build: link

SIM Ticket: link


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the Java-v2 This issue relates to the AWS SDK for Java V2 label Jul 1, 2025
@tejasgn1 tejasgn1 added Follow After Scouts, more languages are added to examples as Follows. Feature Scenario A simple code example to show how certain tasks can be accomplished using several services and SDKs. labels Jul 1, 2025
@tejasgn1 tejasgn1 requested a review from scmacdon July 1, 2025 23:12
@tejasgn1 tejasgn1 changed the title Java V2: Added the follow for Send and Receive Batches of Message for SQS Java V2: Added the follow for sending and receiving messages in batches for SQS Jul 1, 2025
} catch (IOException e) {
logger.log(Level.SEVERE, "Error reading file", e);
} finally {
// Clean up by deleting the queue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add periods on comments.


import java.util.*;
import java.util.stream.Stream;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at our tests for Java in the Java Standards doc.

https://github.com/awsdocs/aws-doc-sdk-examples/wiki/Java-code-example-standards

For example - use of @testinstance and @TestMethodOrder JUNT annotations

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Scott, I have now updated according to the Java Standards doc and have also added periods in comments.

@tejasgn1 tejasgn1 requested a review from scmacdon July 3, 2025 23:17
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For logging, use Slf4J with a Log4j2 implementation.

rootLogger.setLevel(Level.WARNING);
}
private static final SqsClient sqsClient = SqsClient.builder()
.region(Region.US_WEST_2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This client will try to use a queue that's in the us-west-2 region, but if the queue created in the test uses a different region, the queue won't be found and an error will result. This is what happened to me. So, either specify the the region in both places, or let the user's config determine the region (that's my preference).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Scenario A simple code example to show how certain tasks can be accomplished using several services and SDKs. Follow After Scouts, more languages are added to examples as Follows. Java-v2 This issue relates to the AWS SDK for Java V2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants