-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
base: main
Are you sure you want to change the base?
Conversation
} catch (IOException e) { | ||
logger.log(Level.SEVERE, "Error reading file", e); | ||
} finally { | ||
// Clean up by deleting the queue |
There was a problem hiding this comment.
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; | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.logging.Level; |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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).
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.