Download the PHP package behzadsh/rabbitmq-broadcaster without Composer
On this page you can find all versions of the php package behzadsh/rabbitmq-broadcaster. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package rabbitmq-broadcaster
RabbitMQ Event Broadcaster for Laravel
The main focus of Laravel's event broadcasting module is to enable communication with the client-side of the application. However, it can also be useful for asynchronous communication and message passing between services, especially in a microservices architecture.
This package provides an easy way to broadcast Laravel events to a RabbitMQ server, enabling you to send messages asynchronously and facilitating communication between services in a microservices architecture.
Installation
To install the package, run the following command:
After installing the package, append the broadcaster config as shown in the snippet below to your broadcasting.php
config file:
Then, append the package service provider at the end of the providers
list in your app.php
config file:
Usage
To use the RabbitMQ event broadcaster, your desired event class must implement the
Illuminate\Contracts\Broadcasting\ShouldBroadcast
interface, which requires you to implement the broadcastOn
method.
The broadcastOn
method should return a channel or an array of channels that the event should broadcast on.
Since this package is primarily intended for communicating between internal backend services, channels are not public,
and access to the channels from client-side applications is not allowed. Therefore, it's recommended that you avoid using
the PrivateChannel
, PresenceChannel
, and EncryptedPrivateChannel
and use a simple Channel
instead.
It is recommended to implement the broadcastWith
method if you construct your event with an Eloquent Model. The
broadcastWith
method should return an array that can be serialized into JSON.
All versions of rabbitmq-broadcaster with dependencies
ext-json Version *
php-amqplib/php-amqplib Version ~3.5
illuminate/support Version ^9.0|^10.0
illuminate/contracts Version ^9.0|^10.0
illuminate/broadcasting Version ^9.0|^10.0
illuminate/http Version ^9.0|^10.0