Giter Site home page Giter Site logo

broadway-bundle's Introduction

Broadway

Broadway is a project providing infrastructure and testing helpers for creating CQRS and event sourced applications. Broadway tries hard to not get in your way. The project contains several loosely coupled components that can be used together to provide a full CQRS\ES experience.

build status

About

Read the blog post about this repository at:

Installation

$ composer require broadway/broadway

Documentation

You can find detailed documentation of the Broadway bundle on broadway.github.io/broadway.

Feel free to join #qandidate on freenode with questions and remarks!

Acknowledgements

The broadway project is heavily inspired by other open source project such as AggregateSource, Axon Framework and Ncqrs.

We also like to thank Benjamin, Marijn and Mathias for the conversations we had along the way that helped us shape the broadway project. In particular Marijn for giving us access to his in-house developed CQRS framework.

License

MIT, see LICENSE.

broadway-bundle's People

Contributors

alessandrominoccheri avatar arrgson avatar asm89 avatar bartundmett avatar boedah avatar boekkooi avatar cordoval avatar dependabot-preview[bot] avatar dependabot[bot] avatar derstoffel avatar fritsjanb avatar henrikbjorn avatar kimlai avatar lutacon avatar mantiz avatar matthiasnoback avatar miliooo avatar morawskim avatar msvrtan avatar othillo avatar ricbra avatar richardmiller-zz avatar ruudk avatar tpl0ch avatar wjzijderveld avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

broadway-bundle's Issues

Issue with matthiasnoback/symfony-service-definition-validator

This took a while for me to troubleshoot but I don't think you should use ValidateServiceDefinitionsPass.

The ValidateServiceDefinitionsPass runs validation for every service definition. In my case, using Symfony 3.2.4, there are 3 issues:

Per https://github.com/matthiasnoback/symfony-service-definition-validator#fixing-invalid-service-definitions-in-third-party-bundles, I created a new compiler pass to resolve these issues as well as disabling the @security annotation within sensio/framework-extra-bundle. I was able to load my app without errors.

Reading through the matthiasnoback/symfony-service-definition-validator documentation, it seems that you should be using Matthias\SymfonyServiceDefinitionValidator\ServiceDefinitionValidatorFactory instead. This could be done in a custom compile pass.

Tag release

Would it be possible to tag a release and follow semver?

Make the "front" services public by default

Hello,

As of Symfony 3.4, services are private by default but if we wants to use the Broadway Bundle without always changing the visibility of the services, some of them should be declared public by default. For instance, the "command bus" services can be public by default because in a lot of projects, they will be injected in a Controller or/and retrieved in the DI container. Especially when the Symfony instance does not use a lot of services but is just used as a kind of front controller.

What do you think about it ?

Doc | Documentation page

Hi there,

When I clicked on the link of the documentation, it shows a website where it says the same. No more information is provided.

Where is the official documentation for this project, please?

Best regards.

find a way to functionally test the bundle

I noticed we introduced some bugs that didn't break the tests.

For instance if an incorrect class is used in services.xml you will only notice it when you include this bundle in your app and boot it.

There must be a way to properly test this.

Improper Service Configuration uuid.generator

When setting up the bundle i encountered a problem.

[Symfony\Component\Debug\Exception\FatalThrowableError] Type error: Argument 6 passed to Broadway\EventStore\DBALEventStore::__cons truct() must be an instance of Broadway\UuidGenerator\Converter\BinaryUuidC onverterInterface

The service "broadway.uuid.generator" is configured as "Broadway\UuidGenerator\Rfc4122\Version4Generator.php".

However when initializing the event store schema the DBALEventStore service (broadway.event_store.dbal) takes this service as sixt parameter. The constructor of that class expects this to be "BinaryUuidConverterInterface" which it isn't.

[Error] Cannot initiate the schema

When I use command to initiate the schema for event store I get an error:

docker-compose run php bin/console broadway:event-store:schema:init -vv

                                                                              
  [Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]  
  The parameter "broadway.event_store.dbal.connection" must be defined.       
                                                                              

Exception trace:
 () at /app/var/cache/dev/appDevDebugProjectContainer.php:4436
 appDevDebugProjectContainer->getParameter() at /app/vendor/broadway/broadway-bundle/src/Command/AbstractSchemaEventStoreCommand.php:51
 Broadway\Bundle\BroadwayBundle\Command\AbstractSchemaEventStoreCommand->initialize() at /app/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:230
 Symfony\Component\Console\Command\Command->run() at /app/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:852
 Symfony\Component\Console\Application->doRunCommand() at /app/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:189
 Symfony\Component\Console\Application->doRun() at /app/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:80
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /app/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:120
 Symfony\Component\Console\Application->run() at /app/bin/console:28

OK, so i decided to update the config:


...

# Doctrine Configuration
doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                driver:   pdo_pgsql
                host:     "%database_host%"
                port:     "%database_port%"
                dbname:   "%database_name%"
                user:     "%database_user%"
                password: "%database_password%"
                charset:  UTF8
        # if using pdo_sqlite as your database driver:
        #   1. add the path in parameters.yml
        #     e.g. database_path: "%kernel.root_dir%/../var/data/data.sqlite"
        #   2. Uncomment database_path in parameters.yml.dist
        #   3. Uncomment next line:
        #path:     "%database_path%"

    orm:
        auto_generate_proxy_classes: "%kernel.debug%"
        naming_strategy: doctrine.orm.naming_strategy.underscore
        auto_mapping: true

...

broadway:
    event_store:
        dbal:
            connection:       default
            table:            events
            use_binary:       false # If you want to use UUIDs to be stored as BINARY(16), required DBAL >= 2.5.0
    command_handling:
        logger:               logger # If you want to log every command handled, provide the logger's service id here (e.g. "logger")
    read_model:
        repository:           elasticsearch
        elasticsearch:
            hosts:
                # Default:
                - elastica:9200
    serializer:
        payload:              broadway.simple_interface_serializer
        readmodel:            broadway.simple_interface_serializer
        metadata:             broadway.simple_interface_serializer

It doesn't work. I don't know how to define this, could you tell me what i'm doing wrong? ;)

BTW documentation for this project could be a little more accurate ;)

Symfony 6.0

Is there anything which breaks with an updated constraint for Symfony 6.0?

Missing docs for subscribing command handlers.

I cannot find a way to automaticly register (subscribe) CommandHandlers in CommandBus. Is there a way? Should I do it by DependencyInjection or other similar way?

In demo app, there is config file named domain.xml, and the broadway_demo.basket.command_handler is tagged by broadway.command_handler, but in my app it doesn't work ( I created a service in service.xml).

You should fullfil the missing part of the docs ๐Ÿ˜‰

[RFC] decide on usage of doctrine-bundle by the commands

The broadway:event-store:schema commands require doctrine/doctrine-bundle.

Now that the DBAL event store is split from broadway/broadway and the opinionated DBAL implementation is (about to be) removed, it no longer makes sense to depend on the DoctrineBundle.

I suggest to remove the event store commands and describe how to create the events table in the README of the event-store-dbal project.

Where are broadway event-store schema commands?

Hi.

I'm installed Broadway bundle in a symfony4 project. But I can't execute broadway commands to create event store schema.

I've got installed:

broadway/broadway                   2.0.1              Infrastructure and testing helpers for creating CQRS and event sourced applications.
broadway/broadway-bundle            0.4.1              Symfony bundle for broadway/broadway.
broadway/event-store-dbal           0.2.0              Event store implementation using doctrine/dbal
broadway/uuid-generator             0.4.0              UUID generator for broadway/broadway.

Registered bundle:

<?php

return [
    JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true],
    Broadway\Bundle\BroadwayBundle\BroadwayBundle::class => ['all' => true],
    Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true],
    Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
    ...
];

In config/packages/broadway.yaml

broadway:
  event_store: "my_dbal_event_store"

In config/services.ymal

services:
    my_dbal_event_store:
      class: Broadway\EventStore\Dbal\DBALEventStore
      arguments:
        - "@doctrine.dbal.default_connection"
        - "@broadway.serializer.payload"
        - "@broadway.serializer.metadata"
        - "events"
        - false
        - "@broadway.uuid.converter"

Any idea why I can see commands?.
Thks.

Cannot specify custom Event Store

Hi all,
I'm trying to define a custom event store implementation following the guidelines in the README: I created a class implementing Broadway\EventStore\EventStore and exposed it as a service.

When I try to use it specifying this configuration

broadway:
    event_store: 'AppBundle\LegacyPhroophEventStore'

I got an error: Invalid type for path "broadway.event_store". Expected array, but got string

Is there something I got wrong? Using broadway 1.1.0 with BroadwayBundle 0.2.3

edit: it seems then current bundle configuration does not allow this. It needs to be changed in something like

broadway:
    event_store:
        repository: custom
        custom: "AppBundle\LegacyPhroophEventStore"

What do you think? I can send a PR for that

Can't create events table.

I'm using bundle version 0.3.0 and I can't create my table events.
I'm reading doc but I can works with this bundle. Is documentation right?.

I'm installed with composer:

broadway/broadway                     1.1.0   Infrastructure and testing helpers for creating CQRS...
broadway/broadway-bundle              0.3.0   Symfony bundle for broadway/broadway.
broadway/broadway-saga                0.2.1   Proof-of-concept component providing saga functional...
broadway/event-store-dbal             0.1.2   Event store implementation using doctrine/dbal
broadway/uuid-generator               0.4.0   UUID generator for broadway/broadway. matthiasnoback/broadway-serialization v2.1.0  Serialization helpers for Broadway

My AppKernel:

public function registerBundles()
    {
        $bundles = [
           ...
            new \JMS\SerializerBundle\JMSSerializerBundle(),
            new \Broadway\Bundle\BroadwayBundle\BroadwayBundle(),
            new \BroadwaySerialization\SymfonyIntegration\BroadwaySerializationBundle()
           ....
        ];

...
        return $bundles;
    }

My config:

services.yml

services:
  my.event_store.dbal.connection:
    class: Broadway\EventStore\Dbal\DBALEventStore
    arguments:
      - "@doctrine.dbal.default_connection"
      - "@broadway.serializer.payload"
      - "@broadway.serializer.metadata"
      - "events"
      - false
      - "@broadway.uuid.converter"

config.yml

broadway:
  event_store: "my.event_store.dbal.connection"

When I run command:

bin/console broadway:event-store:schema:init

                                                                              
  [Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]  
  The parameter "broadway.event_store.dbal.connection" must be defined.       
                                                                              

improve bundle configuration

requirement: using a custom implementation (event store, read model, saga) should be configurable in the bundle by specifying a service id, e.g.:

broadway:
    event_store:
            type: service
            id: my_acme.event_store

as proposed in

or

broadway:
    event_store: my_acme.event_store # default "broadway.event_store.in_memory"

see POC in 1d89930

another solution is to tag your custom implementation and have a compile pass register them.

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.