{"action":"created","issue":{"url":"https://api.github.com/repos/qandidate-labs/broadway/issues/148","labels_url":"https://api.github.com/repos/qandidate-labs/broadway/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/qandidate-labs/broadway/issues/148/comments","events_url":"https://api.github.com/repos/qandidate-labs/broadway/issues/148/events","html_url":"https://github.com/qandidate-labs/broadway/issues/148","id":64924815,"number":148,"title":"Component to replay event streams to event bus","user":{"login":"cyberwolf","id":95102,"avatar_url":"https://avatars.githubusercontent.com/u/95102?v=3","gravatar_id":"","url":"https://api.github.com/users/cyberwolf","html_url":"https://github.com/cyberwolf","followers_url":"https://api.github.com/users/cyberwolf/followers","following_url":"https://api.github.com/users/cyberwolf/following{/other_user}","gists_url":"https://api.github.com/users/cyberwolf/gists{/gist_id}","starred_url":"https://api.github.com/users/cyberwolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyberwolf/subscriptions","organizations_url":"https://api.github.com/users/cyberwolf/orgs","repos_url":"https://api.github.com/users/cyberwolf/repos","events_url":"https://api.github.com/users/cyberwolf/events{/privacy}","received_events_url":"https://api.github.com/users/cyberwolf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-03-28T10:08:22Z","updated_at":"2015-11-20T14:13:14Z","closed_at":null,"body":"It would be nice to have a component that can replay all events from an event store (in historical order) to an event bus. This would facilitate a few use cases, like:\r\n- correcting faulty read models\r\n- initialize new read models\r\n\r\nWe've already coded a callable class EventStream specific for DBAL (https://github.com/cultuurnet/udb3-php/commit/9af9770ca1bfa3976f977f802cb85a0f05d0132f) which returns a PHP Generator for iterating over all stored events in the right historical order, and it's used in a CLI command in our SIlex application (https://github.com/cultuurnet/udb3-silex/blob/feature/event-stream-replay/src/Console/ReplayCommand.php#L47). Unfortunately we had to copy quite some code from the DBAL EventStore to our class. Splitting up some methods like deserializeEvent() from the DBALEventStore to a separate class might be a good idea, or the EventStore interface itself could be extended to allow to retrieve all events. There are several possibilities. I'd be happy to discuss this a bit more with you."},"comment":{"url":"https://api.github.com/repos/qandidate-labs/broadway/issues/comments/158412043","html_url":"https://github.com/qandidate-labs/broadway/issues/148#issuecomment-158412043","issue_url":"https://api.github.com/repos/qandidate-labs/broadway/issues/148","id":158412043,"user":{"login":"tudobala","id":3206336,"avatar_url":"https://avatars.githubusercontent.com/u/3206336?v=3","gravatar_id":"","url":"https://api.github.com/users/tudobala","html_url":"https://github.com/tudobala","followers_url":"https://api.github.com/users/tudobala/followers","following_url":"https://api.github.com/users/tudobala/following{/other_user}","gists_url":"https://api.github.com/users/tudobala/gists{/gist_id}","starred_url":"https://api.github.com/users/tudobala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tudobala/subscriptions","organizations_url":"https://api.github.com/users/tudobala/orgs","repos_url":"https://api.github.com/users/tudobala/repos","events_url":"https://api.github.com/users/tudobala/events{/privacy}","received_events_url":"https://api.github.com/users/tudobala/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T14:13:14Z","updated_at":"2015-11-20T14:13:14Z","body":"@wjzijderveld,\r\n\r\nI have the same thoughts as yours. Also, on my code that does read model/elasticsearch queries, I found it easier and more flexible to call the ES Client directly to submit the queries, rather than use the Broadway implementation. Even for generating the not_analyzed indexes for read model IDs I am doing it outside with an external PHP script."}}