question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SQS Queue.receive_messages returns one message when set MaxNumberOfMessages to 10.

See original GitHub issue

Hi 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:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

16reactions
giladneuralcommented, Apr 3, 2017

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…

5reactions
joshuaherrcommented, Dec 29, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found