maksimovic / service-bus
PHP Enterprise Service Bus Implementation supporting CQRS and DDD
v7.0.3
2026-04-17 07:13 UTC
Requires
- php: ^8.1
- prooph/common: ^4.0.0
Requires (Dev)
- phpunit/phpunit: ^10.5
- psr/container: ^1.0
- react/promise: ^3.3
- sandrokeil/interop-config: ^2.0.1
Suggests
- prooph/event-store-bus-bridge: Let the EventBus dispatch persisted DomainEvents
- prooph/service-bus-zfc-rbac-bridge: Use ZfcRbac as authorization service for route and finalize guard
- psr/container: ^1.0 for usage of provided factories
- react/promise: ^3.3 for usage with provided QueryBus
- sandrokeil/interop-config: For usage of provided factories
- zendframework/zend-servicemanager: Use Zend ServiceManager to lazy load your handlers and listeners
Replaces
- dev-master
- v7.0.3
- v7.0.2
- v7.0.1
- v7.0.0
- v6.3.0
- v6.2.2
- v6.2.1
- v6.2.0
- v6.1.1
- v6.1.0
- v6.0.3
- v6.0.2
- v6.0.1
- v6.0.0
- v6.0.0-beta3
- v6.0.0-beta2
- v6.0.0-beta1
- 5.x-dev
- v5.2.1
- v5.2.0
- v5.1.0
- v5.0.3
- v5.0.2
- v5.0.1
- v5.0
- v4.6
- v4.5
- v4.4.1
- v4.4
- v4.3
- v4.2
- v4.2-beta.1
- v4.1.2
- v4.1.1
- v4.1
- v4.0
- v3.2
- v3.1
- v3.0.1
- v3.0
- v2.0
- v1.3.1
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.2
- v1.0.1
- v1.0.0
- v0.4.0
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.0
- 0.1.1
- 0.1.0
- dev-phpstan-fix
- dev-fix-conflict
- dev-php85
This package is auto-updated.
Last update: 2026-04-17 07:14:09 UTC
README
Fork of prooph/service-bus — maintained for PHP 8.1–8.5 compatibility.
PHP lightweight message bus supporting CQRS and micro services.
Installation
$ composer require maksimovic/service-bus
Requires PHP 8.1 or later.
Fork rationale
The upstream package was last released in 2021 and is no longer maintained. This fork:
- Bumps minimum PHP to 8.1
- Fixes implicit nullable type deprecations (PHP 8.4+)
- Upgrades PHPUnit to
^10.5with schema migration - Migrates tests from
phpspec/prophecyto native PHPUnit mocks - Upgrades
react/promiseto^3.3(Promise→PromiseInterface,done()removal) - Replaces Travis CI with GitHub Actions (PHP 8.1–8.5 matrix)
Behavior is otherwise unchanged.
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.
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(); $router->route('Prooph\ServiceBus\Example\Command\EchoText') ->to(function (EchoText $aCommand): void { echo $aCommand->getText(); }); $router->attachToMessageBus($commandBus); $echoText = new EchoText('It works'); $commandBus->dispatch($echoText); // Output: It works
Documentation
See the original documentation at prooph/service-bus.
License
Released under the BSD-3-Clause License.