Comments (6)
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.
Thanks for this solution @ambroisemaupate . Do you know if this works with "prooph/event-store": "6.6.1"
too?!
from event-store-symfony-bundle.
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.
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.
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.
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)
- Allow service references with a prefix @
- Raise version of symfony dependencies HOT 3
- Deprecated relying on its factory's return-type to define the class of service HOT 2
- How to use SingleStreamStrategy? HOT 6
- Projections defined as services cannot be found HOT 2
- Graceful shutdown on interrupt HOT 14
- Options for projection in command HOT 16
- Prevent autowiring to malfunction while defining aggregate repositories HOT 1
- Command event-store:projection:names does not use provided limit HOT 2
- Incorrect values on parameter prooph_event_store.projection_managers HOT 1
- ProjectionManagerFactory doesn't handle EventStoreDecorator HOT 1
- Cannot autowire service when installing the bundle HOT 2
- Repository autowiring doesn't work HOT 3
- Add a --time-limit option for event-store:projection:run command
- Drop dependency to prooph/event-sourcing
- Plugins and Metadata Enrichers are not recognized HOT 50
- Security Warning by dependabot HOT 3
- Deprecated callable reference to self in PHP 8.2 HOT 1
- Symfony 7 support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from event-store-symfony-bundle.