Skip to content

Latest commit

 

History

History
72 lines (49 loc) · 1.48 KB

README.md

File metadata and controls

72 lines (49 loc) · 1.48 KB

esb

Total Downloads Latest Version License

Esb support Pub/Sub in php and also support queue driver for Laravel.

Installation

Install with composer

composer require idanieldrew/esb

To publish the config

php artisan vendor:publish

and then select "esb-config" tag

Usage

Quick start

Publish

Publish messages with default exchange

use Idanieldrew\Esb\Facades\Esb;

// Publish message to queue
Esb::publish('queue','message'); 

Consume

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);
        });