broadway/event-store-mongodb

Missing serializer services in example setup

UlrichEckhardt opened this issue · 1 comments

The services reference broadway.serializer.payload and broadway.serializer.metadata which aren't defined. For simplicity reasons, I'd just do this:

services:
    broadway.event_store.mongodb_client:
        class: MongoDB\Client
        arguments:
            - 'mongodb://%mongodb_host%:%mongodb_port%'

    broadway.event_store.mongodb_collection:
        class: MongoDB\Collection
        factory:
            - '@broadway.event_store.mongodb_client'
            - 'selectCollection'
        arguments:
            - '%mongodb_database%'
            - 'events'

    broadway.serializer:
        class: Broadway\Serializer\ReflectionSerializer

    broadway.event_store.mongodb:
        class: Broadway\EventStore\MongoDB\MongoDBEventStore
        arguments:
            - '@broadway.event_store.mongodb_collection'
            - '@broadway.serializer'
            - '@broadway.serializer'
  • This formats argument lists on separate lines (better readability, IMHO).
  • It adds a serializer.
  • It uses the serializer for both payload and metadata.
stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.