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 | if ($e instanceof FatalExceptionInterface) { |
||
30 | throw $e; |
||
31 | } |
||
32 | $msg->delivery_info['channel']->basic_nack($msg->delivery_info['delivery_tag'], true, true); |
||
33 | } catch (\Exception $e) { |
||
34 | $this->logger->error("Exception caught while consuming message.", [ |
||
35 | 'exception' => $e |
||
36 | ]); |
||
37 | if ($e instanceof FatalExceptionInterface) { |
||
38 | throw $e; |
||
39 | } |
||
40 | $msg->delivery_info['channel']->basic_nack($msg->delivery_info['delivery_tag'], true, false); |
||
41 | } |
||
42 | } |
||
43 | |||
46 |