SQS Queue.receive_messages returns one message when set MaxNumberOfMessages to 10.
See original GitHub issueHi Guys, I can see two messages in my SQS queue in AWS web console. But method receive_messages in sqs.Queue only return one message each time. I am a little confused about this.
Here is my python code below:
sqs = boto3.resource('sqs', region_name="cn-north-1", aws_access_key_id=access_id, aws_secret_access_key=access_secret)
queue = sqs.Queue(sqs_url)
messages = queue.receive_messages(MaxNumberOfMessages=10,WaitTimeSeconds=10)
for message in messages:
print message
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:13 (4 by maintainers)
Top Results From Across the Web
ReceiveMessage - Amazon Simple Queue Service
Retrieves one or more messages (up to 10), from the specified queue. ... The parameter is applied to the messages that Amazon SQS...
Read more >SQS maxNumberOfMessages - java - Stack Overflow
Thus, a particular ReceiveMessage request might not return all of your messages. However, if you have fewer than 1,000 messages in your queue,...
Read more >AWS SQS ReceiveMessage: Syntax, Importance, Parameters ...
All – Returns the entire set of values. ApproximateFirstReceiveTimestamp – Indicates when the messages were first received from the queue (in ...
Read more >Processing more than 10 SQS messages concurrently with ...
First, it attempts to receive messages. Spring Cloud sets MaxNumberOfMessages to 10 by default[2] – the maximum value allowed by SQS ...
Read more >Amazon::SQS::Simple::Queue - OO API for representing ...
Returns one or more "Amazon::SQS::Simple::Message" objects (depending on whether ... As ReceiveMessage(MaxNumberOfMessages => 10) DeleteMessage($message, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Don’t count on the order of receiving the messages - put a timestamp in the message.
[Update] I take it back - SQS does support FIFO - more here: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html
There are only two hard problems in distributed systems:
2 . Exactly-once delivery 1 . Guaranteed order of messages 2 . Exactly-once delivery…
Yeah I’m still having this issue now. I have a queue with 2 messages in it. When I call receive_message() through boto3 I only get 1 message back. When I use the Poll for Messages button through the AWS console I get back two messages (which is correct). This is incredibly discouraging and doesn’t build much trust in boto3.