Giter Site home page Giter Site logo

event-gateway-service's Introduction

Readme

Event Gateway service for Laravel

This package is built to share events between micro services though Event Gateway. It's separated under client and service part.

Installation

Install using composer:

composer require springboardvr/event-gateway-service

Publish config:

php artisan vendor:publish --provider="SpringboardVR\EventGatewayService\Providers\EventGatewayServiceProvider" --tag="config"

Client

Client is responsible for receiving events from Event Gateway and dispatching them internally.

Setup

  1. Create you client account on Event Gateway and set your client secret and client url (by default https://HOST/events).
  2. Set your client secret in config/event-gateway.php or EVENTGATEWAY_CLIENT_SECRET env variable.

Usage

Set channels you would like to listen to in Event Gateway subscribers section. Events are always starting with service for example billing_service.invoice.created.

Example:

Event::listen('billing_service.invoice.created', function ($invoice) {
    PaymentService::payInvoice($invoice);
});

Service

Service is responsible for sharing selected events with event Gateway and other micro services.

Setup

  1. Create a new service at Event Gateway and set service name with service secret.
  2. Setup you Event Gateway, service name, and secret in config/event-gateway.php.
  3. Setup events you would like to share with Event Gateway using event-gateway.channels config.

Usage

Events matching event-gateway.channels pattern (currently no wildcard support), are going to be shared with other micro services subscribed to namespace used in channels configuration. Event Gateway will automatically add service prefix to every event dispatched. For example if you are using service name billing and setup channel

'invoice.saved' => [
    'eloquent.saved: App/Models/Invoice',
 ]

every save event of invoice model going to be dispatched as billing.invoice.saved.

event-gateway-service's People

Contributors

matthewhallcom avatar sl0wik avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ilakskill

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.