{"id":22387844,"url":"https://github.com/rekalogika/domain-event-outbox","last_synced_at":"2025-07-31T06:32:16.653Z","repository":{"id":226887361,"uuid":"769681508","full_name":"rekalogika/domain-event-outbox","owner":"rekalogika","description":"Implementation of the transactional outbox pattern on top of rekalogika/domain-event","archived":false,"fork":false,"pushed_at":"2024-09-16T15:47:35.000Z","size":58,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-15T20:07:19.609Z","etag":null,"topics":["cqrs","ddd","doctrine","domain","domain-driven-design","domain-event","event","event-dispatcher","event-listener","microservice","outbox","symfony"],"latest_commit_sha":null,"homepage":"https://rekalogika.dev/domain-event","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rekalogika.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"priyadi"}},"created_at":"2024-03-09T18:54:47.000Z","updated_at":"2024-11-08T16:46:50.000Z","dependencies_parsed_at":"2024-03-10T12:23:13.189Z","dependency_job_id":"ca420f9d-a198-4a85-9420-c4dd3b8e6eb2","html_url":"https://github.com/rekalogika/domain-event-outbox","commit_stats":null,"previous_names":["rekalogika/domain-event-outbox"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekalogika%2Fdomain-event-outbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekalogika%2Fdomain-event-outbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekalogika%2Fdomain-event-outbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekalogika%2Fdomain-event-outbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rekalogika","download_url":"https://codeload.github.com/rekalogika/domain-event-outbox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228219741,"owners_count":17887058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cqrs","ddd","doctrine","domain","domain-driven-design","domain-event","event","event-dispatcher","event-listener","microservice","outbox","symfony"],"created_at":"2024-12-05T02:11:18.646Z","updated_at":"2024-12-05T02:11:19.190Z","avatar_url":"https://github.com/rekalogika.png","language":"PHP","funding_links":["https://github.com/sponsors/priyadi"],"categories":[],"sub_categories":[],"readme":"# rekalogika/domain-event-outbox\n\nImplementation of the transactional outbox pattern on top of the\n`rekalogika/domain-event` package.\n\nFull documentation is available at\n[rekalogika.dev/domain-event](https://rekalogika.dev/domain-event).\n\n## Synopsis\n\n```php\n//\n// The event\n//\n\nfinal readonly class PostChanged\n{\n    public function __construct(public string $postId) {}\n}\n\n//\n// The entity\n//\n\nuse Rekalogika\\Contracts\\DomainEvent\\DomainEventEmitterInterface;\nuse Rekalogika\\Contracts\\DomainEvent\\DomainEventEmitterTrait;\n\nclass Post implements DomainEventEmitterInterface\n{\n    use DomainEventEmitterTrait;\n    \n    // ...\n\n    public function setTitle(string $title): void\n    {\n        $this-\u003etitle = $title;\n        // highlight-next-line\n        $this-\u003erecordEvent(new PostChanged($this-\u003eid));\n    }\n\n    // ...\n}\n\n//\n// The listener\n//\n\nuse Psr\\Log\\LoggerInterface;\nuse Rekalogika\\Contracts\\DomainEvent\\Attribute\\AsPublishedDomainEventListener;\n\nclass PostEventListener\n{\n    public function __construct(private LoggerInterface $logger) {}\n    \n    // highlight-next-line\n    #[AsPublishedDomainEventListener]\n    public function onPostChanged(PostChanged $event) {\n        $postId = $event-\u003epostId;\n\n        $this-\u003elogger-\u003einfo(\"Post $postId has been changed.\");\n    }\n}\n\n//\n// The caller\n//\n\nuse Doctrine\\ORM\\EntityManagerInterface;\n\n/** @var Post $post */\n/** @var EntityManagerInterface $entityManager */\n\n$post-\u003esetTitle('New title');\n$entityManager-\u003eflush();\n\n// During the flush above, the event will be recorded in the outbox table in the\n// database. Then the message relay service is executed, and will publish the\n// events on the event bus. When the event bus announces the event, the listener\n// will be executed.\n```\n\n## Documentation\n\n[rekalogika.dev/domain-event](https://rekalogika.dev/domain-event).\n\n## License\n\nMIT\n\n## Contributing\n\nThe `rekalogika/domain-event-outbox` repository is a read-only repo split from\nthe main repo. Issues and pull requests should be submitted to the\n[rekalogika/domain-event-src](https://github.com/rekalogika/domain-event-src)\nmonorepo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frekalogika%2Fdomain-event-outbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frekalogika%2Fdomain-event-outbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frekalogika%2Fdomain-event-outbox/lists"}