<?php
#代理连接
$conn = new AMQPConnection( $configs );#$config是连接rabbitmq的配置
$conn->connect();
$chanel = new AMQPChannel( $conn );
$queue = new AMQPQueue( $chanel );
$queue->setFlags( AMQP_PASSIVE );
$queueName = 'purchase.sync.#.wms.queue';#需要监控的队列名
$queue->setName( $queueName );
$messageCount = $queue->declare();#队列No acked数据量
补上$configs
的参数
$configs = [
'host' => RABBITMQ_HOST ,
'port' => RABBITMQ_PORT ,
'vhost' => RABBITMQ_VHOST ,
'login' => RABBITMQ_USER ,
'password' => RABBITMQ_PASS ,
];