aws icon indicating copy to clipboard operation
aws copied to clipboard

Receive Empty Messages SQS

Open alaglil opened this issue 3 years ago • 1 comments

I use FIFO Queue and , I get an empty result in receiveMessage function, thanks for your help

 $result = $sqs->sendMessage(new SendMessageRequest([
                    'QueueUrl' => $queueUrl,
                    'DelaySeconds' => 0,
                    'MessageGroupId' =>  'report',
                    'MessageDeduplicationId'  =>  $clientId
                    'MessageBody' => 'mesage test',
];
  $result = $sqs->receiveMessage(new ReceiveMessageRequest([
        'QueueUrl' => $queueUrl,
        'AttributeNames' => [MessageSystemAttributeName::MESSAGE_GROUP_ID, MessageSystemAttributeName::MESSAGE_DEDUPLICATION_ID],
        'WaitTimeSeconds' => 20,
        'VisibilityTimeout' => 20,
        'MaxNumberOfMessages' => 1, 
        'MessageAttributeNames' => ['All']
    ]));

alaglil avatar Aug 19 '22 11:08 alaglil

I found the problem I have a lambda SQS trigger function which calls a php endpoint which has its role of receiving the messages, as indicated above, the lambda function deletes the messages before it arrives in the endpoint I'm a little lost what is the best way to call the receiveMessages function automaticly and process them ?

alaglil avatar Aug 19 '22 12:08 alaglil

Hi, i want to contribute in this project.Please assign me in this project to work in this issue. @alaglil @markdorison @shouze @j0k3r @ddeboer

DhwanishShah avatar Sep 09 '22 15:09 DhwanishShah

I want to contribute to solve this issue, please let me contribute as it would help in my acedamics and your problem will be solved.

Jehan-h20220012 avatar Sep 10 '22 09:09 Jehan-h20220012

I'm closing the issue because there is no bug in the SDK. The purpose of SQS message is to be delivered once to a single consumer, If you have concurrent applications (lambda + PHP) that consumes the same queues, you can not predict which one will get the message.

jderusse avatar Sep 10 '22 10:09 jderusse