Skip to content

Commit

Permalink
Merge pull request #24 from Spriz/patch-1
Browse files Browse the repository at this point in the history
Fallback if AWS doens't include MessageAttributes
  • Loading branch information
lorenzo committed Jun 18, 2018
2 parents 2b3f885 + 59c1588 commit b9a35e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Shell/Task/QueueWorkerTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ protected function _work($name, $job)
{
foreach ($job->get('Messages') as $message) {
$data = json_decode($message['Body'], true);
$return = call_user_func($this->callbacks[$name], $data, $message['ReceiptHandle'], $message['MessageAttributes']);
$messageAttributes = isset($message['MessageAttributes']) ? $message['MessageAttributes'] : [];
$return = call_user_func($this->callbacks[$name], $data, $message['ReceiptHandle'], $messageAttributes);
if ($return === true) {
$this->getSimpleQueue()->deleteMessage($name, $message['ReceiptHandle']);
}
Expand Down

0 comments on commit b9a35e9

Please sign in to comment.