Download the PHP package usmonaliyev/laravel-simple-rabbitmq without Composer
On this page you can find all versions of the php package usmonaliyev/laravel-simple-rabbitmq. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download usmonaliyev/laravel-simple-rabbitmq
More information about usmonaliyev/laravel-simple-rabbitmq
Files in usmonaliyev/laravel-simple-rabbitmq
Package laravel-simple-rabbitmq
Short Description This package provides simple usage of rabbitmq.
License MIT
Homepage https://github.com/usmonaliyev/laravel-simple-rabbitmq
Informations about the package laravel-simple-rabbitmq
laravel-simple-rabbitmq
The package for simplified RabbitMQ usage, supporting multiple connections, easy publishing, and consumer mode.
Documentation
- Русский (RU)
- O'zbekcha (UZ)
Key Features
-
Multiple Connections: Effortlessly manage multiple RabbitMQ connections within the same application.
-
Exchange supporting: You can push messages to exchanges
-
Message Publishing: Easily publish messages to queues and exchange with a fluent, chainable syntax.
-
Consumer Mode: Enable consumers to receive and process messages from queues in real time.
- Manage queues and exchanges in config file: You can register queues and exchanges in
config/simple-mq.php
and define them in easy way which isamqp:define-queues
command.
Installation
You can install the package via composer:
Next step you must publish config and action register files:
As a result of this command, you will have a configuration file config/simple-mq.php
and a registry file
routes/amqp-handlers.php
.
The config/simple-mq.php
config file contains RabbitMQ connections with credentials, queues, default connection and
default queue.
The next stage is configure .env
file.
Usage
The package can publish and consume messages
Publishing
You can publish a message with default connection and default queue:
Also, exchange
function publish message to RabbitMq exchange:
If you have multiply connection to RabbitMq, you can publish a message with connection
method.
Consuming
Create app/AMQP/Handlers
folder and create your handler classes.
For example:
Don't forget acknowledge message end of process, else consumer does not accept next message.
Then register your handler in routes/amqp-handlers.php
file.
To consume messages use:
The command requires two arguments which are connection
and queue
.\
If you don't give them, command uses default connection and queue.
Plans
- [ ] Exchange configuration in
config/simple-mq.php
- [ ] Setup testing.
Testing
License
The MIT License.
All versions of laravel-simple-rabbitmq with dependencies
illuminate/console Version *
illuminate/support Version *
php-amqplib/php-amqplib Version ^3.7