prooph/service-bus
Composer 安装命令:
composer require prooph/service-bus
包简介
PHP Enterprise Service Bus Implementation supporting CQRS and DDD
关键字:
README 文档
README
PHP 7.1+ lightweight message bus supporting CQRS and Micro Services
Important
This library will receive support until December 31, 2019 and will then be deprecated.
For further information see the official announcement here: https://www.sasaprolic.com/2018/08/the-future-of-prooph-components.html
Messaging API
prooph/service-bus is a lightweight messaging facade. It allows you to define the API of your model with the help of messages.
- Command messages describe actions your model can handle.
- Event messages describe things that happened while your model handled a command.
- Query messages describe available information that can be fetched from your (read) model.
prooph/service-bus shields your model. Data input and output ports become irrelevant and no longer influence business logic. We're looking at you Hexagonal Architecture.
prooph/service-bus decouples your model from any framework. You can use a web framework like Zend, Symfony, Laravel and co. to handle http requests and pass them via prooph/service-bus to your model but you can also receive the same messages via CLI or from a messaging system like RabbitMQ or Beanstalkd.
It is also a perfect fit for microservices architecture as it provides an abstraction layer for message-based inter-service communication.
Installation
You can install prooph/service-bus via composer by running composer require prooph/service-bus, which will install the latest version as requirement to your composer.json.
Quick Start
<?php use Prooph\ServiceBus\CommandBus; use Prooph\ServiceBus\Example\Command\EchoText; use Prooph\ServiceBus\Plugin\Router\CommandRouter; $commandBus = new CommandBus(); $router = new CommandRouter(); //Register a callback as CommandHandler for the EchoText command $router->route('Prooph\ServiceBus\Example\Command\EchoText') ->to(function (EchoText $aCommand): void { echo $aCommand->getText(); }); //Expand command bus with the router plugin $router->attachToMessageBus($commandBus); //We create a new Command $echoText = new EchoText('It works'); //... and dispatch it $commandBus->dispatch($echoText); //Output should be: It works
Live Coding Introduction
Documentation
Documentation is in the docs tree, and can be compiled using bookdown.
$ php ./vendor/bin/bookdown docs/bookdown.json $ php -S 0.0.0.0:8080 -t docs/html/
Then browse to http://localhost:8080/
Support
- Ask questions on Stack Overflow tagged with #prooph.
- File issues at https://github.com/prooph/service-bus/issues.
- Say hello in the prooph gitter chat.
Contribute
Please feel free to fork and extend existing or add new features and send a pull request with your changes! To establish a consistent code quality, please provide unit tests for all your changes and may adapt the documentation.
License
Released under the New BSD License.
prooph/service-bus 适用场景与选型建议
prooph/service-bus 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.42M 次下载、GitHub Stars 达 442, 最近一次更新时间为 2014 年 04 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「messaging」 「ddd」 「cqrs」 「prooph」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 prooph/service-bus 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 prooph/service-bus 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 prooph/service-bus 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Runn Me! Value Objects Library
Interfaces, Traits and Nominal Classes used by Domain Entities Implementing Domain Events
Implementation of the transactional outbox pattern on top of rekalogika/domain-event
Build a domain-oriented application on Laravel Framework
Symfony bundle for broadway/broadway.
Provides Symfony param converters for mediagone/types-common package.
统计信息
- 总下载量: 1.42M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 445
- 点击次数: 21
- 依赖项目数: 38
- 推荐数: 2
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2014-04-20
