Skip to content

Commit d9beed8

Browse files
committed
also check deleteAfterReject property when doing setup
1 parent 5038021 commit d9beed8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,15 +433,15 @@ public function setup(): void
433433
$this->connection->clearLastError();
434434
}
435435

436-
if ($this->deleteAfterAck) {
436+
if ($this->deleteAfterAck || $this->deleteAfterReject) {
437437
$groups = $this->connection->xinfo('GROUPS', $this->stream);
438438
if (
439439
// support for Redis extension version 5+
440440
(\is_array($groups) && 1 < \count($groups))
441441
// support for Redis extension version 4.x
442442
|| (\is_string($groups) && substr_count($groups, '"name"'))
443443
) {
444-
throw new LogicException(sprintf('More than one group exists for stream "%s", delete_after_ack can not be enabled as it risks deleting messages before all groups could consume them.', $this->stream));
444+
throw new LogicException(sprintf('More than one group exists for stream "%s", delete_after_ack and delete_after_reject can not be enabled as it risks deleting messages before all groups could consume them.', $this->stream));
445445
}
446446
}
447447

0 commit comments

Comments
 (0)