Provide the full URL for the Amazon SQS queue instead of just the name of the queue.
1public abstract class AmazonSqsNameUrlNoncompliant implements Callable<Message> {
2
3 public void non_compliant() {
4 final String queueName = "queueName";
5 // Noncompliant: queue name passed to SQS instead of queue URL.
6 sqsMetricsClient.changeMessageVisibility(queueName, "ReceiptHandle", "VisibilityTimeout");
7 }
8}
1public abstract class AmazonSqsNameUrlCompliant implements Callable<Message> {
2
3 public void compliant() {
4 final String queueUrl = "queueUrl";
5 // Compliant: queue URL passed to SQS instead of queue name.
6 sqsMetricsClient.changeMessageVisibility(queueUrl, "ReceiptHandle", "VisibilityTimeout");
7 }
8}