diff --git a/pkg/redis/RedisConsumer.php b/pkg/redis/RedisConsumer.php index 9c93b642a..7e8b2d0ba 100644 --- a/pkg/redis/RedisConsumer.php +++ b/pkg/redis/RedisConsumer.php @@ -96,19 +96,8 @@ public function reject(Message $message, bool $requeue = false): void { InvalidMessageException::assertMessageInstanceOf($message, RedisMessage::class); - $this->acknowledge($message); - - if ($requeue) { - $message = $this->getContext()->getSerializer()->toMessage($message->getReservedKey()); - $message->setRedelivered(true); - - if ($message->getTimeToLive()) { - $message->setHeader('expires_at', time() + $message->getTimeToLive()); - } - - $payload = $this->getContext()->getSerializer()->toString($message); - - $this->getRedis()->lpush($this->queue->getName(), $payload); + if (!$requeue) { + $this->acknowledge($message); } }