ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(queueURL);
List<com.amazonaws.services.sqs.model.Message> messages = sqs.receiveMessage(receiveMessageRequest).getMessages();
Whenever I try and pull all of the messages from my SQS queue, the size of the 'messages' list is always 1. How do I ensure that every item in the queue is added to that list?
Any advise would be appreciated!
You need to supply the maximum number of messages to return. Amazon SQS never returns more messages than this value (however, fewer messages might be returned). Valid values are 1 to 10. Default is 1.
See setMaxNumberOfMessages(Integer maxNumberOfMessages).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With