• Stars
    star
    440
  • Rank 99,050 (Top 2 %)
  • Language
    PHP
  • License
    BSD 3-Clause "New...
  • Created over 10 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PHP Lightweight Message Bus supporting CQRS.

Prooph Service Bus

PHP 7.1+ lightweight message bus supporting CQRS and Micro Services

Build Status Coverage Status Gitter

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.

  1. Command messages describe actions your model can handle.
  2. Event messages describe things that happened while your model handled a command.
  3. 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.

prooph_architecture

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

Prooph Service Bus v6

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

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.

More Repositories

1

event-store

PHP 7.4 EventStore Implementation
PHP
547
star
2

event-sourcing

Provides basic functionality for event sourced aggregates.
PHP
262
star
3

proophessor-do

prooph components in action
JavaScript
254
star
4

docker-files

Collection of prooph docker files
M4
249
star
5

proophessor-do-symfony

Symfony version of proophessor-do CQRS + Event Sourcing example app
JavaScript
170
star
6

event-store-client

PHP Event Store Client Implementation
PHP
113
star
7

pdo-event-store

PDO implementation of ProophEventStore http://getprooph.org
PHP
110
star
8

event-store-symfony-bundle

Event Store Symfony Bundle
PHP
109
star
9

laravel-package

Laravel package for prooph components to get started out of the box with message bus, CQRS, event sourcing and snapshots
PHP
100
star
10

service-bus-symfony-bundle

Symfony Bundle - PHP Lightweight Message Bus supporting CQRS
PHP
89
star
11

common

Common classes used across prooph components
PHP
85
star
12

proophessor

Exploring prooph components
PHP
84
star
13

micro

Functional prooph for microservices
PHP
53
star
14

micro-do

Microservice version of the famous proophessor-do event sourcing app
PHP
42
star
15

event-store-bus-bridge

Marry CQRS with Event Sourcing
PHP
37
star
16

message-flow-analyzer

Static code analyzer for message flow in a prooph powered project
PHP
30
star
17

event-store-http-client

PHP 7.2 Event Store HTTP Client Implementation
PHP
25
star
18

pdo-snapshot-store

PDO Snapshot Store
PHP
25
star
19

php-cs-fixer-config

PHP CS Fixer config for prooph components
PHP
24
star
20

event-store-mgmt-ui

Event Store Management UI
JavaScript
23
star
21

snapshot-store

Snapshot Store
PHP
20
star
22

snapshotter

Take aggregate snapshots with ease
PHP
19
star
23

event-store-http-api

Prooph EventStore HTTP API
PHP
18
star
24

documentation

CSS
17
star
25

standard-projections

Standard projections to use with Prooph EventStore
PHP
15
star
26

laravel-example

PHP
15
star
27

psr7-middleware

Consume prooph messages with a PSR7 middleware
PHP
14
star
28

link

Automated Workflow Processing
JavaScript
13
star
29

event-store-doctrine-adapter

[Deprecated] Doctrine Adapter for ProophEventStore
PHP
13
star
30

humus-amqp-producer

HumusAmqp Producer for Prooph Service Bus
PHP
12
star
31

annotations

Prooph Annotations
PHP
12
star
32

psb-http-producer

Http Message Producer for Prooph Service Bus using httplug
PHP
11
star
33

no-mvc

[experimental] No View, No Controller, Just a Model and a Bus
PHP
11
star
34

micro-cli

Command line interface to create prooph microservices
PHP
11
star
35

http-middleware

PSR compatible middleware to integrate prooph with a middleware dispatcher
PHP
11
star
36

psb-enqueue-producer

Enqueue Producer for Prooph Service Bus http://getprooph.org
PHP
10
star
37

docs

prooph docs
9
star
38

fun-facts-service

Microservice to fetch and serve fun facts about prooph repositories
PHP
8
star
39

event-store-benchmarks

Benchmarks for prooph event store
PHP
8
star
40

redis-event-store

Redis Adapter for ProophEventStore
8
star
41

psb-bernard-producer

Bernard Message Producer for Prooph Service Bus
PHP
8
star
42

event-store-flywheel-adapter

Flywheel Adapter for ProophEventStore http://getprooph.org
PHP
7
star
43

service-bus-zfc-rbac-bridge

Marry Service Bus with ZfcRbac
PHP
7
star
44

arangodb-snapshot-store

ArangoDb Snapshot Store implementation
PHP
7
star
45

snapshot-doctrine-adapter

[Deprecated] Doctrine Adapter for the Snapshot Store
PHP
6
star
46

processing

Deprecated package. Will be removed in 03/2016! Use:
PHP
6
star
47

psb-zeromq-producer

ZeroMQ Message Producer for Prooph Service Bus.
PHP
6
star
48

event-store-http-middleware

PSR-15 Event Store HTTP API middleware
PHP
6
star
49

event-store-mongodb-adapter

[Deprecated] MongoDB Adapter for ProophEventStore
PHP
6
star
50

event-store-redis-adapter

[Deprecated] Redis Adapter for ProophEventStore http://getprooph.org
PHP
5
star
51

event-store-adapter-benchmarks

[deprecated] Prooph EventStore Adapter Benchmarks
PHP
5
star
52

ProophServiceBusModule

[deprecated] ZF 2 Module for ProophServiceBus. Use:
PHP
5
star
53

mongodb-snapshot-store

MongoDB Snapshot Store implementation
PHP
4
star
54

snapshot-mongodb-adapter

[Deprecated] MongoDB Adapter for the Snapshot Store
PHP
4
star
55

prooph-pack

A prooph "pack" recipe for Symfony flex
4
star
56

snapshot-redis-adapter

[Deprecated] Redis Adapter for the Snapshot Store http://getprooph.org
PHP
4
star
57

httplug-event-store

HTTP event-store implementation talking with http-api
PHP
4
star
58

snapshot-memcached-adapter

[Deprecated] Memcached Adapter for the Snapshot Store
PHP
3
star
59

psb-kafka-producer

3
star
60

docs-template

CSS
3
star
61

event-store-bus-bridge-symfony-bundle

[deprecated] Event Store Bus Bridge Symfony Bundle
PHP
3
star
62

psb-gearman-producer

[deprecated] Gearman Message Producer for Prooph Service Bus
3
star
63

ProophEventStoreModule

[deprecated] ZF 2 Module for ProophEventStore. Use:
PHP
2
star
64

link-message-queue

Message Queue Module for prooph LINK
PHP
2
star
65

link-process-manager

Process configurator for prooph LINK
PHP
2
star
66

memcached-snapshot-store

Memcached Snapshot Store implementation
PHP
2
star
67

link-sql-connector

SQL connector module for prooph LINK
PHP
1
star
68

various-benchmarks

various benchmarks for decision making
1
star
69

link-app-core

Application core for prooph LINK
PHP
1
star
70

psb-php-resque-producer

[deprecated] php-resque message producer for Prooph Service Bus
PHP
1
star
71

event-store-zf2-adapter

[Abandoned] ZF2 DB Adapter for ProophEventStore
PHP
1
star
72

link-dashboard

Dashboard module for prooph LINK
PHP
1
star