Amazon has announced its new FIFO SQS service , and I would like to use it in the Laravel queue to solve some concurrency issues.
I created several new queues and changed the configurations. However, I got an error MissingParametersaying
The request must contain the parameter MessageGroupId.
So I changed the file vendor/laravel/framework/src/Illuminate/Queue/SqsQueue.php
public function pushRaw($payload, $queue = null, array $options = [])
{
$response = $this->sqs->sendMessage(['QueueUrl' => $this->getQueue($queue), 'MessageBody' => $payload,
'MessageGroupId' => env('APP_ENV', getenv('APP_ENV'))]);
return $response->get('MessageId');
}
public function later($delay, $job, $data = '', $queue = null)
{
$payload = $this->createPayload($job, $data);
$delay = $this->getSeconds($delay);
return $this->sqs->sendMessage([
'QueueUrl' => $this->getQueue($queue), 'MessageBody' => $payload, 'DelaySeconds' => $delay,
'MessageGroupId' => env('APP_ENV', getenv('APP_ENV'))
])->get('MessageId');
}
I use APP_ENVgroups as an identifier (this is a separate message queue, so it really doesn't matter much. I just want everything to be FIFO).
But I still get the same error message. How could I fix this? Any help would be appreciated.
(by the way, where sendMessagedid the SDK determine ? I can find a stub for it, but I did not find a detailed implementation)