|
3 | 3 | * Copyright © Magento, Inc. All rights reserved.
|
4 | 4 | * See COPYING.txt for license details.
|
5 | 5 | */
|
| 6 | + |
6 | 7 | namespace Magento\Framework\MessageQueue;
|
7 | 8 |
|
8 | 9 | use Exception;
|
@@ -93,8 +94,7 @@ class Consumer implements ConsumerInterface
|
93 | 94 | * @param MessageController|null $messageController
|
94 | 95 | * @param MessageValidator|null $messageValidator
|
95 | 96 | * @param EnvelopeFactory|null $envelopeFactory
|
96 |
| - * |
97 |
| - * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
| 97 | + * @SuppressWarnings(PHPMD.ExcessiveParameterList) |
98 | 98 | */
|
99 | 99 | public function __construct(
|
100 | 100 | CallbackInvokerInterface $invoker,
|
@@ -247,19 +247,23 @@ private function getTransactionCallback(QueueInterface $queue)
|
247 | 247 | $queue->acknowledge($message);
|
248 | 248 | } catch (MessageLockException $exception) {
|
249 | 249 | $queue->acknowledge($message);
|
250 |
| - } catch (ConnectionLostException $e) { |
| 250 | + } catch (ConnectionLostException $exception) { |
251 | 251 | if ($lock) {
|
252 |
| - $this->resource->getConnection() |
253 |
| - ->delete($this->resource->getTableName('queue_lock'), ['id = ?' => $lock->getId()]); |
| 252 | + $this->resource->getConnection()->delete( |
| 253 | + $this->resource->getTableName('queue_lock'), |
| 254 | + ['id = ?' => $lock->getId()] |
| 255 | + ); |
254 | 256 | }
|
255 |
| - } catch (NotFoundException $e) { |
| 257 | + } catch (NotFoundException $exception) { |
256 | 258 | $queue->acknowledge($message);
|
257 |
| - $this->logger->warning($e->getMessage()); |
258 |
| - } catch (Exception $e) { |
259 |
| - $queue->reject($message, false, $e->getMessage()); |
| 259 | + $this->logger->warning($exception->getMessage()); |
| 260 | + } catch (Exception $exception) { |
| 261 | + $queue->reject($message, false, $exception->getMessage()); |
260 | 262 | if ($lock) {
|
261 |
| - $this->resource->getConnection() |
262 |
| - ->delete($this->resource->getTableName('queue_lock'), ['id = ?' => $lock->getId()]); |
| 263 | + $this->resource->getConnection()->delete( |
| 264 | + $this->resource->getTableName('queue_lock'), |
| 265 | + ['id = ?' => $lock->getId()] |
| 266 | + ); |
263 | 267 | }
|
264 | 268 | }
|
265 | 269 | };
|
|
0 commit comments