Skip to content

Commit

Permalink
Merge pull request #26 from run-as-root/develop
Browse files Browse the repository at this point in the history
Make plugin method arguments optional as in the original method
  • Loading branch information
cristiano-pacheco authored Apr 26, 2023
2 parents 80030f3 + 486f319 commit 5c79e91
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Plugin/HandleQueueMessageRejectPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ public function aroundReject(
QueueInterface $subject,
callable $proceed,
EnvelopeInterface $envelope,
bool $requeue,
string $error
bool $requeue = true,
string $rejectionMessage = null
): void {
if (!$error) {
$proceed($envelope, $requeue, $error);
if (!$rejectionMessage) {
$proceed($envelope, $requeue, $rejectionMessage);
return;
}

$shouldBeSavedForRetry = $this->isMessageShouldBeSavedForRetryService->execute($envelope);

if (!$shouldBeSavedForRetry) {
$proceed($envelope, $requeue, $error);
$proceed($envelope, $requeue, $rejectionMessage);
return;
}

$this->saveFailedMessageService->execute($envelope, $error);
$this->saveFailedMessageService->execute($envelope, $rejectionMessage);
$subject->acknowledge($envelope);
}
}

0 comments on commit 5c79e91

Please sign in to comment.