Linked Questions

Popular Questions

Error using SQS with multiple Laravel queue readers

Asked by At

I am using Laravel Jobs to read messages from an SQS queue (Laravel version 5.7)

Following Laravel indications I am using supervisor to run multiple queue:work processes at the same time.

All goes well until I get this SQS error related to the message availability:

InvalidParameterValue (client): Value 
... for parameter ReceiptHandle is invalid. Reason: Message does not exist or 
is not available for visibility timeout change. - <?xml version="1.0"?> 
<ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><Error>
<Type>Sender</Type><Code>InvalidParameterValue</Code><Message>Value ...
for parameter ReceiptHandle is invalid. Reason: Message does not exist or is 
not available for visibility timeout change.</Message><Detail/></Error>
<RequestId>8c1d28b7-a02c-5059-8b65-7c6292a0e56e</RequestId></ErrorResponse> 
{"exception":"[object] (Aws\\Sqs\\Exception\\SqsException(code: 0): Error 
executing \"ChangeMessageVisibility\" on \"https://sqs.eu-central-
1.amazonaws.com/123123123123/myQueue\"; AWS HTTP error: Client error: `POST 
https://sqs.eu-central-1.amazonaws.com/123123123123/myQueue` resulted in a 
`400 Bad Request` response:

In particular, the strange thing is Message does not exist or is not available for visibility timeout change.

Each supervisor process calls command=php /home/application/artisan queue:work without a --sleep=3 (I'd like the process to be reactive and not waiting for 3 seconds in case nothing was in the queue) nor a --tries=3 (I need all the tasks to be completed, so I don't put a limit to the tries parameter)

In case the message is not existing (and I can't exclude this possibility) why does the process fetches it from the queue ? Is there anything I can do to prevent it ?

Related Questions