Download the PHP package hyperlab/laravel-pubsub-rabbitmq without Composer
On this page you can find all versions of the php package hyperlab/laravel-pubsub-rabbitmq. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hyperlab/laravel-pubsub-rabbitmq
More information about hyperlab/laravel-pubsub-rabbitmq
Files in hyperlab/laravel-pubsub-rabbitmq
Package laravel-pubsub-rabbitmq
Short Description An opinionated approach to implement Pub/Sub messaging in Laravel using RabbitMQ.
License MIT
Homepage https://github.com/hyperlab/laravel-pubsub-rabbitmq
Informations about the package laravel-pubsub-rabbitmq
Laravel Pub/Sub RabbitMQ
This package provides an opinionated approach to implement Pub/Sub messaging in Laravel using RabbitMQ.
Installation
Install the package via composer:
Publish the config/pubsub.php
config file:
Publish the routes/subscriptions.php
routes file:
Add the following snippet to your application's config/queue.php
file.
More details about the configuration options for the queue connection can be found in the readme of the vyuldashev/laravel-queue-rabbitmq package.
Configuration
You can configure the package to suit your needs through the config/pubsub.php
config file. By default, the file looks like this:
Subscribers
In order for your application to receive messages from RabbitMQ, it needs to subscribe to one or more message types.
By default, these subscriptions can be defined in the routes/subscriptions.php
file. However, the path to this file can
be changed in the configuration file.
The contents of the subscriptions file should look like this:
The file returns an associative array in which:
- a key represents a type of messages that the application wants to receive
- a value represents the class within your application that handles the incoming message of this type
The handler of a subscription can be defined in two ways:
-
By referencing a class
In this case, the package looks for a public method in the class that accepts a
Hyperlab\LaravelPubSubRabbitMQ\Subscriber\Message
as argument. This method can be called anything, as shown here: - By referencing a class and method
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Hyperlab
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-pubsub-rabbitmq with dependencies
adbario/php-dot-notation Version ^2.2
illuminate/contracts Version ^8.0
spatie/laravel-package-tools Version ^1.4.3
vladimir-yuldashev/laravel-queue-rabbitmq Version ^11.2