Skip to content

Commit 697d951

Browse files
committed
Fixed message deleting in consumer
1 parent 10f507d commit 697d951

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: pkg/dbal/DbalConsumer.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,12 @@ public function reject(Message $message, bool $requeue = false): void
144144
$this->deleteMessage($message->getDeliveryId());
145145
}
146146

147-
private function deleteMessage(?string $deliveryId): void
147+
private function deleteMessage(string $deliveryId): void
148148
{
149+
if (empty($deliveryId)) {
150+
throw new \LogicException(sprintf('Expected record was removed but it is not. Delivery id: "%s"', $deliveryId));
151+
}
152+
149153
$this->getConnection()->delete(
150154
$this->getContext()->getTableName(),
151155
['delivery_id' => $deliveryId],

0 commit comments

Comments
 (0)