Download the PHP package ivan-grebnev/laravel-rabbitmq without Composer
On this page you can find all versions of the php package ivan-grebnev/laravel-rabbitmq. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ivan-grebnev/laravel-rabbitmq
More information about ivan-grebnev/laravel-rabbitmq
Files in ivan-grebnev/laravel-rabbitmq
Package laravel-rabbitmq
Short Description Laravel queue RabbitMQ driver.
License MIT
Informations about the package laravel-rabbitmq
Laravel queue RabbitMQ driver
By default, the Laravel framework doesn't include a RabbitMQ driver for the queue feature. This package adds compatibility with this message broker.
You will also be able to exchange messages with other systems that don't support Laravel native queue message format.
Installation
Just install this package by Composer:
And set environment variables with credentials to connect to RabbitMQ server, for example in file:
Configuration
Default configuration places in . You can override any config options in your project's in the rabbitmq section, for example:
For all tasks config takes from "defaults" section, but can be overridden in parameters of concrete task.
All possible settings you can see in source config file with comments https://github.com/ivan-grebnev/laravel-rabbitmq/blob/master/src/config/default.php.
Tasks
What does it mean task? The Laravel uses the term "queue" to refer to an application's messaging channel with a queue server in either direction. But the RabbitMQ message broker additionally has exchange as its entry point, and exchange can have exactly the same name as queue. For this reason, the concept of task was introduced to separate configuration settings. So the example below will work:
This is necessary when RabbitMQ queues are used not only for the internal needs of the application, but for exchanging data with other systems, then we push messages to one exchange or queue, and pull our messages from others.
Thus, in the package sources, task is like queue in Laravel, and queue is exactly the queue of RabbitMQ. So to execute the example above:
and
Custom jobs
There are three types of Job:
- Sending to exchange / queue job
- Pulling by worker job
- Executing job
...to be continued...
All versions of laravel-rabbitmq with dependencies
ext-json Version *
illuminate/queue Version ^8.64 || ^9.0 || ^10.0 || ^11.0
php-amqplib/php-amqplib Version ^3.0