We have SQS Standard Message Queue and its growing very fast. most of time we receiving old notification. We have configure Message Retention Period for 2 days. Is there any way to receive more than 10 messages programmatically. Following is my code to revive SQS Messages from amazon.
private IEnumerable<Message> getMessagesFromQ(string accessKeyId, string secretAccessKey, string myQueueURL)
{
using (var amazonSQSClient = new AmazonSQSClient(accessKeyId, secretAccessKey, Amazon.RegionEndpoint.USWest2))
{
ReceiveMessageRequest recieveMessageRequest =
new ReceiveMessageRequest();
recieveMessageRequest.QueueUrl = myQueueURL;
recieveMessageRequest.MaxNumberOfMessages = 10;
ReceiveMessageResponse receiveMessageResponse =
amazonSQSClient.ReceiveMessage(recieveMessageRequest);
return receiveMessageResponse.Messages;
}
}