Esb support Pub/Sub in php and also support queue driver for Laravel.
Install with composer
composer require idanieldrew/esb
To publish the config
php artisan vendor:publish
and then select "esb-config" tag
Publish messages with default exchange
use Idanieldrew\Esb\Facades\Esb;
// Publish message to queue
Esb::publish('queue','message');
Consume messages with default exchange
use Idanieldrew\Esb\Facades\Esb;
// Consume messages from queue
Esb::consume('queue', function ($message, $res) {
var_dump($message->body);
});
Consume messages from default queue in esb-config:
use Idanieldrew\Esb\Facades\Esb;
Esb::consume('', function ($message, $res) {
var_dump($message->body);
});