Giter Club home page Giter Club logo

Comments (6)

ambroisemaupate avatar ambroisemaupate commented on June 19, 2024

Ok, after looking at services compilation, I found it out 👍

I needed to tag my MetadataEnricher with prooph_event_store.%name%.metadata_enricher:

app.metadata_enricher:
    class: "App\\EventStore\\MetadataEnricher\\AuthenticatedEventMetadataEnricher"
    autowire: true
    autoconfigure: true
    tags:
       - { name: 'prooph_event_store.default_store.metadata_enricher' }

from event-store-symfony-bundle.

webdevilopers avatar webdevilopers commented on June 19, 2024

Thanks for this solution @ambroisemaupate . Do you know if this works with "prooph/event-store": "6.6.1" too?!

from event-store-symfony-bundle.

webdevilopers avatar webdevilopers commented on June 19, 2024

I'm currently trying to migrate this to v6.6.1.

prooph_service_bus:
    event_buses:
        acme_event_bus:
            plugins:
                - 'prooph_service_bus.on_event_invoke_strategy'
                - 'event_enricher.plugin'

services:
    prooph_event_store_bus_bridge.event_enricher:
        class: Acme\Infrastructure\EventStore\MetadataEnricher\EventEnricherPlugin
        tags:
            - { name: 'prooph_event_store.default_store.plugin' }

It looks like the Plugin is registered but I get:

Type error: Argument 1 passed to Prooph\ServiceBus\MessageBus::utilize() must implement interface Prooph\Common\Event\ActionEventListenerAggregate, instance of Acme\Infrastructure\EventStore\MetadataEnricher\EventEnricherPlugin given

My Plugin is based on the example by @prolic :

I also tried switching to the ActionEventListenerAggregate interface. But when adding the "attach" method in Sascha's example I get Attempted to call an undefined method named "trackHandler":

    public function attach(ActionEventEmitter $emitter)
    {
        //Attach with a low priority, so that a potential message translator has done its job already
        $this->trackHandler($emitter->attachListener(CommandBus::EVENT_INITIALIZE, [$this, 'onInitialize'], -1000));
    }

I Guess I'm mixing up a lot of versions here. Maybe someone can help. No need to re-open this as an issue since it is not linked to the current version.

from event-store-symfony-bundle.

webdevilopers avatar webdevilopers commented on June 19, 2024

Ok, I was missing the DetachAggregateHandlers trait.
After adding it I get the same message when using the Plugin interface:
Message dispatch failed during locate-handler phase. Error: Given parameter listener should be callable or an instance of ActionEventListener. Got array

Guess I am still missing some method...

from event-store-symfony-bundle.

webdevilopers avatar webdevilopers commented on June 19, 2024

Ok, looks like my service classes go a little mixed up. I found a solution and will post it here soon.

from event-store-symfony-bundle.

webdevilopers avatar webdevilopers commented on June 19, 2024

My final services config looks exactly like the suggested solution by @ambroisemaupate . For some reason symfony did not correctly autowire it.

Excuse me!

from event-store-symfony-bundle.

Related Issues (20)

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.