{"action":"opened","issue":{"url":"https://api.github.com/repos/qandidate-labs/broadway/issues/249","repository_url":"https://api.github.com/repos/qandidate-labs/broadway","labels_url":"https://api.github.com/repos/qandidate-labs/broadway/issues/249/labels{/name}","comments_url":"https://api.github.com/repos/qandidate-labs/broadway/issues/249/comments","events_url":"https://api.github.com/repos/qandidate-labs/broadway/issues/249/events","html_url":"https://github.com/qandidate-labs/broadway/issues/249","id":142557437,"number":249,"title":"Metadata enrichment does not have any effect","user":{"login":"aleixverges","id":3007412,"avatar_url":"https://avatars.githubusercontent.com/u/3007412?v=3","gravatar_id":"","url":"https://api.github.com/users/aleixverges","html_url":"https://github.com/aleixverges","followers_url":"https://api.github.com/users/aleixverges/followers","following_url":"https://api.github.com/users/aleixverges/following{/other_user}","gists_url":"https://api.github.com/users/aleixverges/gists{/gist_id}","starred_url":"https://api.github.com/users/aleixverges/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleixverges/subscriptions","organizations_url":"https://api.github.com/users/aleixverges/orgs","repos_url":"https://api.github.com/users/aleixverges/repos","events_url":"https://api.github.com/users/aleixverges/events{/privacy}","received_events_url":"https://api.github.com/users/aleixverges/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-22T06:13:27Z","updated_at":"2016-03-22T06:13:27Z","closed_at":null,"body":"Hi,\r\n\r\nI've my metadata enricher registered as follows using symfony:\r\n\r\n```\r\nacme.metadata_enricher.author:\r\n    class: Acme\\CoreBundle\\Infrastructure\\Messaging\\AuthorMetadataEnricher  \r\n        arguments: [@security.token_storage]  \r\n        tags:  \r\n            - { name: broadway.metadata_enricher }\r\n```  \r\n\r\nThe Metadata Enricher is coded as follows:\r\n\r\n```\r\n<?php\r\n\r\nnamespace Acme\\CoreBundle\\Infrastructure\\Messaging;\r\n\r\nuse Broadway\\Domain\\Metadata;\r\nuse Broadway\\EventSourcing\\MetadataEnrichment\\MetadataEnricherInterface;\r\nuse Symfony\\Component\\Security\\Core\\Authentication\\Token\\Storage\\TokenStorageInterface;\r\n\r\nclass AuthorMetadataEnricher implements MetadataEnricherInterface\r\n{\r\n    /**\r\n     * @var TokenStorageInterface\r\n     */\r\n    private $tokenStorage;\r\n\r\n    /**\r\n     * @param TokenStorageInterface $tokenStorage\r\n     */\r\n    public function __construct(TokenStorageInterface $tokenStorage)\r\n    {\r\n        $this->tokenStorage = $tokenStorage;\r\n    }\r\n\r\n    /**\r\n     * @param Metadata $existingMetadata\r\n     * @return Metadata\r\n     */\r\n    public function enrich(Metadata $existingMetadata)\r\n    {\r\n        $username = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUsername() : 'System';\r\n        $metadata = new Metadata(['author' => $username]);\r\n\r\n        return $existingMetadata->merge($metadata);\r\n    }\r\n}\r\n```  \r\n\r\nAnd my Domain Events are applied using the \"apply\" method defined in EventSourcedAggregateRoot class.\r\n\r\n   The problem is that no metadata is registered in my events and it seems that the enrichment does not take part during the event flow. Is there anything I'm missing?\r\n\r\nThanks  "}}