Skip to content

Commit f0f241e

Browse files
committed
use RecoveryActionException to request Mesenger consumer restart
1 parent 9062ff5 commit f0f241e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848
"doctrine/orm": "^2.19",
4949
"phpunit/phpunit": "^9.6"
5050
},
51+
"conflict": {
52+
"win32service/service-library": "<1.0.2"
53+
},
5154
"suggest": {
5255
"ext-win32service": "On Windows only, install this extension to run PHP Service on Windows Service Manager"
5356
},

lib/Model/MessengerServiceRunner.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Symfony\Component\Messenger\Stamp\NoAutoAckStamp;
2121
use Symfony\Component\Messenger\Stamp\ReceivedStamp;
2222
use Symfony\Component\Messenger\Transport\Receiver\ReceiverInterface;
23+
use Win32Service\Exception\RecoveryActionException;
2324
use Win32Service\Model\AbstractServiceRunner;
2425
use Win32ServiceBundle\Event\MessengerWorkerMessageFailedEvent;
2526
use Win32ServiceBundle\Event\MessengerWorkerMessageHandledEvent;
@@ -106,6 +107,8 @@ public function stop(): void
106107

107108
$this->shouldStop = true;
108109
$this->requestStop();
110+
111+
throw new RecoveryActionException('Restart requested');
109112
}
110113

111114
protected function beforeContinue(): void

0 commit comments

Comments
 (0)