I am using the AWS SDK for PHP to push a message into an AWS SQS queue.
I’d like to be able to set the visibility timeout for specific messages to be different than the default. It would make sense to be able to do that, but I can’t find a way to do that based on the documentation.
$message = $sqsClient->sendMessage([
'QueueUrl' => $queueUrl,
'MessageBody' => json_encode($request),
]);
I can see the ChangeVisibilityTimeout API call, but this requires me to either poll or consume that message then change it which seems counter-intuitive.
Ideally, i’d like to send through the visibility timeout at the same time. Is this possible in some way?
2
Answers
Sadly, its not possible.
If your need to delay the message is less than 15 minutes you can use
Send message. check parameter details.