springboardvr/event-gateway-service
Composer 安装命令:
composer require springboardvr/event-gateway-service
包简介
Event Gateway service for Laravel
README 文档
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
- Create you client account on Event Gateway and set your client secret and client url (by default
https://HOST/events). - Set your client secret in
config/event-gateway.phporEVENTGATEWAY_CLIENT_SECRETenv 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
- Create a new service at Event Gateway and set service name with service secret.
- Setup you Event Gateway, service name, and secret in
config/event-gateway.php. - Setup events you would like to share with Event Gateway using
event-gateway.channelsconfig.
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.
springboardvr/event-gateway-service 适用场景与选型建议
springboardvr/event-gateway-service 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.12k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 09 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 springboardvr/event-gateway-service 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 springboardvr/event-gateway-service 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 3.12k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-13