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