简体   繁体   English

为什么sqs v3 php sdk receive_message MaxNumberOfMessages = 10不返回10条消息?

[英]Why sqs v3 php sdk receive_message MaxNumberOfMessages=10 does not return 10 messages?

I am retrieving message from a queue created through amazon sqs. 我正在从通过Amazon sqs创建的队列中检索消息。 There are around 6 messages in my queue. 我的队列中大约有6条消息。 But I can able to retrieve only one message each time. 但是我每次只能检索一条消息。 In document they mentioned you can retrieve up to 10 messages. 他们在文档中提到您最多可以检索10条消息。 But I am not getting more than one message at a time. 但是我一次不会收到太多信息。

http://docs.aws.amazon.com/aws-sdk-php/v3/api/api-sqs-2012-11-05.html#receivemessage http://docs.aws.amazon.com/aws-sdk-php/v3/api/api-sqs-2012-11-05.html#receivemessage

Here I am setting MaxNumberOfMessages=10 but still I am getting only one message. 在这里,我设置MaxNumberOfMessages = 10,但仍然只收到一条消息。

Can anyone help me to retrieve all messages? 谁能帮助我检索所有消息?

Could be because of this: 原因可能是:

If the number of messages in the queue is small (less than 1000), it is likely you will get fewer messages than you requested per ReceiveMessage call. 如果队列中的消息数量很少(少于1000条),则收到的消息可能会少于每个ReceiveMessage调用所请求的消息。 If the number of messages in the queue is extremely small, you might not receive any messages in a particular ReceiveMessage response; 如果队列中的消息数量非常少,则您在特定的ReceiveMessage响应中可能不会收到任何消息; in which case you should repeat the request. 在这种情况下,您应该重复请求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM