| Conditions | 5 |
| Paths | 9 |
| Total Lines | 24 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function callback($msg) |
||
| 20 | { |
||
| 21 | try { |
||
| 22 | $this->onMessageReceived($msg); |
||
| 23 | |||
| 24 | $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']); |
||
| 25 | } catch (RetryableExceptionInterface $e) { |
||
| 26 | $this->logger->error("Exception caught while consuming message.", [ |
||
| 27 | 'exception' => $e |
||
| 28 | ]); |
||
| 29 | $msg->delivery_info['channel']->basic_nack($msg->delivery_info['delivery_tag'], true, true); |
||
| 30 | if ($e instanceof FatalExceptionInterface) { |
||
| 31 | throw $e; |
||
| 32 | } |
||
| 33 | } catch (\Exception $e) { |
||
| 34 | $this->logger->error("Exception caught while consuming message.", [ |
||
| 35 | 'exception' => $e |
||
| 36 | ]); |
||
| 37 | $msg->delivery_info['channel']->basic_nack($msg->delivery_info['delivery_tag'], true, false); |
||
| 38 | if ($e instanceof FatalExceptionInterface) { |
||
| 39 | throw $e; |
||
| 40 | } |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 46 |