Closed dvdknaap closed 3 years ago
Ok, i found the bug in the software. It thinks it has send the ACK already but this isn't the case.
see vendor/php-amqplib/rabbitmq-bundle/RabbitMq/BatchConsumer.php (function handleProcessFlag) #223
private function handleProcessFlag($deliveryTag, $processFlag)
{
if ($processFlag === ConsumerInterface::MSG_REJECT_REQUEUE || false === $processFlag) {
// Reject and requeue message to RabbitMQ
$this->getMessageChannel($deliveryTag)->basic_reject($deliveryTag, true);
} elseif ($processFlag === ConsumerInterface::MSG_SINGLE_NACK_REQUEUE) {
// NACK and requeue message to RabbitMQ
$this->getMessageChannel($deliveryTag)->basic_nack($deliveryTag, false, true);
} elseif ($processFlag === ConsumerInterface::MSG_REJECT) {
// Reject and drop
$this->getMessageChannel($deliveryTag)->basic_reject($deliveryTag, false);
} elseif ($processFlag == ConsumerInterface::MSG_ACK_SENT) {
// do nothing, ACK should be already sent
} else {
// Remove message from queue only if callback return not false
$this->getMessageChannel($deliveryTag)->basic_ack($deliveryTag);
}
}
the software stops at } elseif ($processFlag == ConsumerInterface::MSG_ACK_SENT) {
and does nothing when i call the getMessageChannel->basic_ack function that you see in the else it sends the ack messages and the items gets removed.
edit: the issue is caused because it's not checking the type when we check for '===' this bug was created in #664
Pull request created for this fix #671
fixed in #671
HI,
i've got an batch:consumer and i send back for all items true back but still the items doesn't get deleted.
When i add another item in the queue it receives the item so it's not stuck but when i check the rabbitmq interface i still see all items in queue under Unacked.
When i stop my script the items get in the ready list again and if i run my script again it picksup the items again.
No partition is near 100% and there is more then enough memory. I've also updated to the latest rabbitmq version but this didn't help either (already at the latest rabbitmqbundle version) Also rebooted the server but didn't help either.
It also doesn't remove the items when i directly return true in batchExecute. Edit: when i get a message in the rabbitMQ interface and reject it it's removed so i geuss something is changed in the rabbitmqbundle because it doesn't receive an ACK i guess
Does anyone knows what this could be ?
Thanks,