Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Implementing Event Store and Event Sourcing with Prooph in Symfony
prooph_service_bus:
command_buses:
rewotec_command_bus:
plugins:
- 'prooph_event_store_bus_bridge.transaction_manager'
router:
type: 'prooph_service_bus.command_bus_router'
routes:
'Rewotec\PersonnelManagement\Application\Employee\SignEmploymentContract': 'rewotec.command.sign_employment_contract_handler'
event_buses:
rewotec_event_bus:
plugins:
- 'prooph_service_bus.on_event_invoke_strategy'
prooph_event_store:
stores:
employment_contract_store:
adapter: 'prooph_event_store.doctrine_adapter.employment_contract_store'
repositories:
employment_contract_collection:
repository_class: Rewotec\PersonnelManagement\Infrastructure\Persistence\Doctrine\EmploymentContractRepositoryImpl
aggregate_type: Rewotec\PersonnelManagement\Domain\Model\EmploymentContract\EmploymentContract
aggregate_translator: 'prooph_event_sourcing.aggregate_translator'
services:
prooph_event_store.doctrine_adapter.employment_contract_store:
class: Prooph\EventStore\Adapter\Doctrine\DoctrineEventStoreAdapter
arguments: ['@database_connection', '@prooph_event_store.message_factory', '@prooph_event_store.message_converter', '@prooph_event_store.payload_serializer', '%prooph_event_store.stream_table_map%']
prooph_event_sourcing.aggregate_translator:
class: Prooph\EventSourcing\EventStoreIntegration\AggregateTranslator
prooph_event_store_bus_bridge.transaction_manager:
class: Prooph\EventStoreBusBridge\TransactionManager
tags:
- { name: 'prooph_event_store.employment_contract_store.plugin' }
prooph_event_store_bus_bridge.employment_contract_event_publisher:
class: Prooph\EventStoreBusBridge\EventPublisher
arguments: ['@prooph_service_bus.rewotec_event_bus']
tags:
- { name: 'prooph_event_store.employment_contract_store.plugin' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment