Skip to content

Commit

Permalink
Merge pull request #35 from joblocal/bugfix/handle-topic-arn-and-subj…
Browse files Browse the repository at this point in the history
…ect-when-checking-routes

also check for topic arn when checking if routes are set
  • Loading branch information
vixone authored Nov 29, 2021
2 parents 1fdaa27 + f0353f8 commit ee3fa1a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Queue/SqsSnsQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,15 @@ protected function routeExists(array $message)
{
$body = json_decode($message['Body'], true);

return isset($body['Subject']) && array_key_exists($body['Subject'], $this->routes);
$possibleRouteParams = ['Subject', 'TopicArn'];

foreach ($possibleRouteParams as $param) {
if (isset($body[$param]) && array_key_exists($body[$param], $this->routes)) {
return true;
}
}

return false;
}

/**
Expand Down

0 comments on commit ee3fa1a

Please sign in to comment.