Skip to content

Commit

Permalink
Update AbstractConsumer.php
Browse files Browse the repository at this point in the history
Fix nack
  • Loading branch information
gparant committed Jan 24, 2018
1 parent 6fc6302 commit ed6224e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/AbstractConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ public function callback($msg)
$this->logger->error("Exception caught while consuming message.", [
'exception' => $e
]);
$msg->delivery_info['channel']->basic_nack($msg->delivery_info['delivery_tag'], true, true);
if ($e instanceof FatalExceptionInterface) {
throw $e;
}
$msg->delivery_info['channel']->basic_nack($msg->delivery_info['delivery_tag'], true, true);
} catch (\Exception $e) {
$this->logger->error("Exception caught while consuming message.", [
'exception' => $e
]);
$msg->delivery_info['channel']->basic_nack($msg->delivery_info['delivery_tag'], true, false);
if ($e instanceof FatalExceptionInterface) {
throw $e;
}
$msg->delivery_info['channel']->basic_nack($msg->delivery_info['delivery_tag'], true, false);
}
}

Expand Down

0 comments on commit ed6224e

Please sign in to comment.