recently, I found a problem when using php-amqplib.
first of all, my channel uses confirm mode, that is, sender confirmation mode
during use, my consumer"s final response is as follows:
$message- > delivery_info ["channel"]-> basic_ack ($message- > delivery_info [" delivery_tag"]);
all respond with delivery_tag, but the official demo in the producer is as follows. Can"t you get the corresponding delivery_tag?
$channel->set_ack_handler(
function (AMQPMessage $message) {
var_Dump($message->delivery_info);
echo "Message acked with content " . $message->body . PHP_EOL;
echo "<br/>";
}
);
in addition, it is found that the value of
$message- > delivery_info ["delivery_tag"] among consumers has been self-increasing with the continuous release of producer messages. If the number of websites is super large, it is easy not to exceed the self-increasing value of tag.