RabbitMQ Driver

Note: This driver has been deprecated since 2.0.2 and will be removed in 2.1. Consider using the amqp_interop driver instead.

This driver works with RabbitMQ queues.

It requires the php-amqplib/php-amqplib package.

Configuration example:

return [
    'bootstrap' => [
        'queue', // The component registers its own console commands
    ],
    'components' => [
        'queue' => [
            'class' => \yii\queue\amqp\Queue::class,
            'host' => 'localhost',
            'port' => 5672,
            'user' => 'guest',
            'password' => 'guest',
            'queueName' => 'queue',
        ],
    ],
];

Console

A console command is used to execute queued jobs.

yii queue/listen

The listen command launches a daemon which infinitely queries the queue. This method is most efficient when the command is properly daemonized via supervisor or systemd.