Use this guide when you need to understand which events are tracked by the queue collector, how proxy services operate, and how to wire the collector manually.
The integration is based on Yiisoft\Queue\Debug\QueueCollector and captures:
- Pushed messages grouped by queue name.
- Message status checks performed via
QueueInterface::status(). - Messages processed by a worker grouped by queue name.
The collector is enabled by registering it in Yii Debug and wrapping tracked services with proxy implementations.
Out of the box (see this package's config/params.php), the following services are wrapped:
Yiisoft\Queue\Provider\QueueProviderInterfaceis wrapped withYiisoft\Queue\Debug\QueueProviderInterfaceProxy. The proxy decorates returned queues withYiisoft\Queue\Debug\QueueDecoratorso thatpush()andstatus()calls are reported to the collector.Yiisoft\Queue\Worker\WorkerInterfaceis wrapped withYiisoft\Queue\Debug\QueueWorkerInterfaceProxyto record message processing events.
To see data in the debug panel, obtain QueueProviderInterface and WorkerInterface from the DI container — the debug proxies are registered there and will not be active if the services are instantiated directly.
If you do not rely on the defaults supplied via yiisoft/config, configure the collector and proxies explicitly:
use Yiisoft\Queue\Debug\QueueCollector;
use Yiisoft\Queue\Debug\QueueProviderInterfaceProxy;
use Yiisoft\Queue\Debug\QueueWorkerInterfaceProxy;
use Yiisoft\Queue\Provider\QueueProviderInterface;
use Yiisoft\Queue\Worker\WorkerInterface;
return [
'yiisoft/yii-debug' => [
'collectors' => [
QueueCollector::class,
],
'trackedServices' => [
QueueProviderInterface::class => [QueueProviderInterfaceProxy::class, QueueCollector::class],
WorkerInterface::class => [QueueWorkerInterfaceProxy::class, QueueCollector::class],
],
],
];