{"id":30317818,"url":"https://github.com/open-cqrs/opencqrs","last_synced_at":"2025-08-17T20:08:45.978Z","repository":{"id":293441218,"uuid":"950002798","full_name":"open-cqrs/opencqrs","owner":"open-cqrs","description":"Java CQRS Framework for the EventSourcingDB","archived":false,"fork":false,"pushed_at":"2025-08-15T11:21:36.000Z","size":3357,"stargazers_count":42,"open_issues_count":9,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-15T13:15:23.357Z","etag":null,"topics":["cqrs","event-sourcing"],"latest_commit_sha":null,"homepage":"https://www.opencqrs.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/open-cqrs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null}},"created_at":"2025-03-17T13:31:37.000Z","updated_at":"2025-08-15T11:18:54.000Z","dependencies_parsed_at":"2025-06-03T13:40:29.289Z","dependency_job_id":"6a34daf9-52ec-40c1-97b4-d6a95a1805d8","html_url":"https://github.com/open-cqrs/opencqrs","commit_stats":null,"previous_names":["open-cqrs/opencqrs"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/open-cqrs/opencqrs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-cqrs%2Fopencqrs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-cqrs%2Fopencqrs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-cqrs%2Fopencqrs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-cqrs%2Fopencqrs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-cqrs","download_url":"https://codeload.github.com/open-cqrs/opencqrs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-cqrs%2Fopencqrs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270899582,"owners_count":24664720,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","event-sourcing"],"created_at":"2025-08-17T20:02:35.135Z","updated_at":"2025-08-17T20:08:45.970Z","avatar_url":"https://github.com/open-cqrs.png","language":"Java","funding_links":[],"categories":["开发框架"],"sub_categories":[],"readme":"# OpenCQRS - Java CQRS Framework for the [EventSourcingDB](https://www.eventsourcingdb.io)\n\n\u003c!-- BADGES_START --\u003e\n[![Maven](https://img.shields.io/maven-metadata/v.svg?color=yellow\u0026label=Maven%20Central\u0026logo=apachemaven\u0026metadataUrl=https%3A%2F%2Frepo1.maven.org%2Fmaven2%2Fcom%2Fopencqrs%2Fframework%2Fmaven-metadata.xml)](https://central.sonatype.com/namespace/com.opencqrs)\n[![Java](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fopen-cqrs%2Fopencqrs%2Frefs%2Fheads%2Fgh-pages%2Fbadges%2Fjdk.json)](https://openjdk.org)\n[![EventSourcingDB](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fopen-cqrs%2Fopencqrs%2Frefs%2Fheads%2Fgh-pages%2Fbadges%2Fesdb.json)](https://www.eventsourcingdb.io)\n[![Spring Boot](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fopen-cqrs%2Fopencqrs%2Frefs%2Fheads%2Fgh-pages%2Fbadges%2Fspring.json)](https://spring.io/projects/spring-boot)\n[![JavaDoc](https://img.shields.io/badge/JavaDoc-click%20here-lightgrey?logo=readthedocs)](https://docs.opencqrs.com/javadoc)\n![Documentation](https://img.shields.io/badge/Documentation-coming%20soon-blue?logo=materialformkdocs)\n\u003c!-- BADGES_END --\u003e\n\n![OpenCQRS](banner.png)\n\nOpenCQRS is a lightweight open source Java framework for building applications based on the CQRS (Command Query Responsibility Segregation) and Event Sourcing patterns.\nIt includes built-in support for testing and offers optional Spring Boot integration to simplify configuration and production deployment. \nOpenCQRS is based on [EventSourcingDB](https://www.eventsourcingdb.io), a third-party event store, and provides a Java client SDK for it.\n\n## Installation\n\nOpenCQRS is available directly from [Maven Central](https://www.maven.org). A [running instance](https://docs.eventsourcingdb.io/getting-started/running-eventsourcingdb/) of the\n[EventSourcingDB](https://www.eventsourcingdb.io) is required as event store. Spring Boot developers must add the following dependencies to their project in order to start developing\nand testing OpenCQRS applications:\n\n### Maven (pom.xml)\n\n```xml\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.opencqrs\u003c/groupId\u003e\n        \u003cartifactId\u003eframework-spring-boot-starter\u003c/artifactId\u003e\n        \u003cversion\u003e{{version}}\u003c/version\u003e\n    \u003c/dependency\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.opencqrs\u003c/groupId\u003e\n        \u003cartifactId\u003eframework-test\u003c/artifactId\u003e\n        \u003cversion\u003e{{version}}\u003c/version\u003e\n        \u003cscope\u003etest\u003c/scope\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n### Gradle (build.gradle.kts)\n\n```kotlin\ndependencies {\n    implementation(\"com.opencqrs:framework-spring-boot-starter:{{version}}\")\n    testImplementation(\"com.opencqrs:framework-test:{{version}}\")\n}\n```\n\nMake sure to configure a proper Spring Boot application name and the connection settings for the\nevent store, i.e. within your `src/main/resources/application.yml`:\n\n```yaml\nspring.application.name: sample-app\n\nesdb:\n  server:\n    uri: http://localhost:3000\n    api-token: \u003csecret\u003e\n```\n\n## Usage\n\nOpenCQRS provides the following core capabilities to support the development of robust CQRS/ES-based systems:\n\n### Command Handling\n\nDefine annotation based command handlers for implementing business logic and publishing new events:\n\n```java\npublic record PurchaseBookCommand(String isbn, String author, String title, long numPages) implements Command {\n\n    @Override\n    default String getSubject() {\n        return \"/book/\" + isbn();\n    }\n}\n\npublic record BookPurchasedEvent(String isbn, String author, String title, long numPages) {}\n\n@CommandHandlerConfiguration\npublic class BookHandling {\n\n    @CommandHandling\n    public String purchase(PurchaseBookCommand command, CommandEventPublisher\u003cBook\u003e publisher) {\n        publisher.publish(\n                new BookPurchasedEvent(command.isbn(), command.author(), command.title(), command.numPages()));\n\n        return command.isbn();\n    }\n}\n```\n\n### State Rebuilding\n\nDefine annotation based state rebuilding handlers for reconstructing command model state:\n\n```java\npublic record Book(String isbn, long numPages) {}\n\n@CommandHandlerConfiguration\npublic class BookHandling {\n\n    @StateRebuilding\n    public Book on(BookPurchasedEvent event) {\n        return new Book(event.isbn(), event.numPages());\n    }\n}\n```\n\n### Testing Command Logic\n\nTest command handling logic using the built-in test fixture support:\n\n```java\n@CommandHandlingTest\npublic class BookHandlingTest {\n\n    @Test\n    public void canBePurchased(@Autowired CommandHandlingTestFixture\u003cBook, PurchaseBookCommand, String\u003e fixture) {\n        fixture.givenNothing()\n                .when(new PurchaseBookCommand(\"4711\", \"JRR Tolkien\", \"LOTR\", 435))\n                .expectSuccessfulExecution()\n                .expectSingleEvent(new BookPurchasedEvent(\"4711\", \"JRR Tolkien\", \"LOTR\", 435));\n    }\n}\n```\n\n### Event Handling\n\nHandle events asynchronously to decouple side effects:\n```java\n@Component\npublic class BookCatalogProjector {\n    \n    @EventHandling(\"catalog\")\n    public void on(BookPurchasedEvent event) {\n        // ...\n    }\n}\n```\n\n### Looking for runnable examples?\n\nCheck out our [OpenCQRS Sample Applications](https://github.com/open-cqrs/opencqrs-samples) repository.  \nIt provides working example projects that demonstrate how to build applications using OpenCQRS.\n\n\n## Project Contents\n\nThis is a multi-module project. It contains the following modules:\n\n| module                                                                         | description                                                                     |\n|--------------------------------------------------------------------------------|---------------------------------------------------------------------------------|\n| [esdb-client](esdb-client)                                                     | Client SDK for the [EventSourcingDB](https://www.eventsourcingdb.io)            |\n| [esdb-client-spring-boot-autoconfigure](esdb-client-spring-boot-autoconfigure) | Spring Boot auto configurations for the ESDB client SDK                         |\n| [esdb-client-spring-boot-starter](esdb-client-spring-boot-starter)             | Spring Boot starter for the ESDB client SDK                                     |\n| [framework](framework)                                                         | CQRS/ES core framework (depends on esdb-client)                                 |\n| [framework-spring-boot-autoconfigure](framework-spring-boot-autoconfigure)     | Spring Boot auto configurations for the CQRS/ES framework                       |\n| [framework-spring-boot-starter](framework-spring-boot-starter)                 | Spring Boot starter for the CQRS/ES framework                                   |\n| [framework-test](framework-test)                                               | CQRS/ES framework test support with optional Spring support                     |\n| [example-application](example-application)                                     | A complete library domain example application based on OpenCQRS and Spring Boot |\n\n\n## License\n\nThis project is licensed under Apache 2.0 – see the [LICENSE file](LICENSE.txt) for details.\n\n## Copyright\n\nCopyright (C) OpenCQRS and contributors. All rights reserved.\n\n## Contributions\n\nWe welcome contributions to OpenCQRS!\nTo ensure a smooth process and consistency with the project's direction, please contact us before starting work on a feature or submitting a pull request. This helps avoid duplicate efforts and ensures alignment.\n\nFeel free to open issues or reach out via email – we’re happy to collaborate.\n\n## Contact\n\nFor questions or feedback, please contact the development team at\n`opencqrs (at) digitalfrontiers.de`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-cqrs%2Fopencqrs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-cqrs%2Fopencqrs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-cqrs%2Fopencqrs/lists"}