{"id":37422708,"url":"https://github.com/capa-cloud/capa-java","last_synced_at":"2026-01-16T06:08:26.432Z","repository":{"id":41101813,"uuid":"375015365","full_name":"capa-cloud/capa-java","owner":"capa-cloud","description":"Mecha SDK of Cloud Application Api. Let the code achieve \"write once, run anywhere\".  With the help of the Capa project, your Java applications have the ability to run across clouds and hybrid clouds with small changes.","archived":false,"fork":false,"pushed_at":"2024-08-19T14:15:08.000Z","size":877,"stargazers_count":14,"open_issues_count":8,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-14T04:45:39.340Z","etag":null,"topics":["aws","cloudnative","dapr","java","mecha","multi-runtime"],"latest_commit_sha":null,"homepage":"https://capa-cloud.github.io/capa.io/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/capa-cloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-06-08T13:16:44.000Z","updated_at":"2025-09-09T15:33:05.000Z","dependencies_parsed_at":"2023-01-23T20:16:18.969Z","dependency_job_id":null,"html_url":"https://github.com/capa-cloud/capa-java","commit_stats":null,"previous_names":["reactivegroup/capa"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/capa-cloud/capa-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capa-cloud%2Fcapa-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capa-cloud%2Fcapa-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capa-cloud%2Fcapa-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capa-cloud%2Fcapa-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capa-cloud","download_url":"https://codeload.github.com/capa-cloud/capa-java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capa-cloud%2Fcapa-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["aws","cloudnative","dapr","java","mecha","multi-runtime"],"created_at":"2026-01-16T06:08:26.326Z","updated_at":"2026-01-16T06:08:26.405Z","avatar_url":"https://github.com/capa-cloud.png","language":"Java","readme":"![logo](./docs/logo.png)\n\n# Capa(cloud application api): To be the high-level api layer for all application runtime.\n\nLet the code achieve \"write once, run anywhere\".\n\nWith the help of the Capa project, your Java applications have the ability to run across clouds and hybrid clouds with small changes.\n\n[中文文档](./README_ZH.md)\n\n[介绍文章](https://capa-cloud.github.io/capa.io/blog/2022/01/18/capa-mecha-sdk-of-cloud-application-api/)\n\n## Motivation\n\n### Mecha architecture\n\nThe Capa project is based on the design concept of the Mecha architecture and uses **rich SDK mode** to provide Multi-Runtime standard API.\n\nYou can simply understand the Capa project as the SDK implementation of [Dapr](https://github.com/dapr/dapr) / [Layotto](https://github.com/mosn/layotto) Sidecar mode projects.\n\nTo understand the design ideas of Mecha architecture, please read the following articles:\n\n[死生之地不可不察：论API标准化对Dapr的重要性](https://www.infoq.cn/article/wjkNGoGaaHyKs7xIyTSB)\n\n[MOSN子项目Layotto：开启服务网格+应用运行时新篇章](http://mosn.io/layotto/#/zh/blog/mosn-subproject-layotto-opening-a-new-chapter-in-service-grid-application-runtime/index)\n\n### Sidecar or SDK\n\nBased on the Mecha architecture concept, Multi-Runtime provides standard API functions in a Sidecar manner, which seems to be the most reasonable choice.\n\nSo why not use Dapr/Layotto and other projects directly, but choose to develop the Capa project of **Rich SDK Mode** instead.\n\nSummary: _The Sidecar architecture represented by Dapr is the future, but it is difficult for many existing enterprises and systems to upgrade to the Sidecar architecture in one step. The rich SDK architecture will exist for a long time._\n\nExtension: _Faced with the huge Java systems, the Capa project will use the rich SDK model to support the transition from the Java system to the Mecha architecture. After Dapr and other projects mature, they can also be seamlessly connected to the Sidecar architecture._\n\nFor specific discussions on this issue, please refer to:\n\n[SDK模型的Dapr API](https://github.com/dapr/dapr/issues/3261)\n\n[Dapr API的未来计划](https://github.com/dapr/dapr/issues/2817)\n\n[Java SDK的设计讨论](https://github.com/mosn/layotto/issues/188)\n\n## Feature\n\n### API definition\n\nCapa API design follow community standards, please refer to the API definitions of open source projects such as Dapr / Layotto.\n\nThe API definition is placed in the following independent warehouse, unbound from the Capa project, and hopes to develop into the community's API standard definition:\n\n+ java: [cloud-runtimes-jvm](https://github.com/reactivegroup/cloud-runtimes-jvm)\n+ python(alpha): [cloud-runtimes-python](https://github.com/reactivegroup/cloud-runtimes-python)\n+ golang(alpha): [cloud-runtimes-golang](https://github.com/reactivegroup/cloud-runtimes-golang)\n\n#### Why not use Dapr API directly?\n\nDue to the current strong binding between Dapr API and Dapr project, we hope that this set of API can become the standard of the entire community, so Capa puts the API definition in an independent warehouse and keeps it synchronized with upstream community standards at all times.\n\nWe hope that Dapr can deploy its API independently, decouple it from the Dapr project, and become a standard for the entire community.\n\nFor the discussion of this item, please see:\n\n[Future plans for dapr api](https://github.com/dapr/dapr/issues/2817)\n\n### Capa features\n\nCapa (Java SDK) is an SDK solution that implements Mecha architecture for Java applications. It currently supports features in the following areas:\n\n+ Service Invocation (RPC)\n+ Configuration Centor (Configuration)\n+ Publish/Subscribe (Pub/Sub)\n+ State Management (State)\n+ Application Log/Metrics/Traces (Telemetry)\n+ Database (SQL) -alpha\n+ Schedule (Schedule) -alpha\n+ ...\n\n## Design\n\n### Capa design\n\nDesign idea: **Standard API + pluggable and replaceable SDK components** mode\n\nIn different distributed middleware fields, Capa provides a unified standard programming API without relying on specific middleware APIs. Therefore, the application does not need to rely on any specific middleware API when programming with Capa, but only needs to rely on Capa's standard programming API.\n\nWhen deployed to different target environments, Capa will load different implementation classes of the standard API into the application. When calling a unified programming API, the underlying runtime will be adapted to different specific middleware SDK implementations.\n\nThe middleware team needs to develop the implementation classes of the standard API in the target environment for different target environments; and the application code can have a \"write once, run anywhere\" development experience.\n\n### SDK design\n\nThe Capa module is divided into the following parts:\n\n* sdk\n* sdk-component\n* sdk-spi\n* sdk-spi-demo/...\n\n![capa-design](./docs/capa-design/capa-layer.PNG)\n\nApplication programming only needs to rely on the SDK, and use the unified programming API defined in the SDK module.\n\nBefore running, the specific SPI implementation package will be introduced as a specific implementation of the unified programming API.\n\n## Usage\n\n### Getting Started\n\n#### Importing Capa's Java SDK\n\nFor a Maven project, add the following to your pom.xml file:\n\n```xml\n\n\u003cproject\u003e\n    ...\n    \u003cdependencies\u003e\n        ...\n        \u003c!-- Capa's core SDK with all features. --\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003egroup.rxcloud\u003c/groupId\u003e\n            \u003cartifactId\u003ecapa-sdk\u003c/artifactId\u003e\n            \u003cversion\u003e1.0.7.RELEASE\u003c/version\u003e\n        \u003c/dependency\u003e\n        ...\n    \u003c/dependencies\u003e\n    ...\n\u003c/project\u003e\n```\n\nSample implementation library:\n\n```xml\n\n\u003cproject\u003e\n    ...\n    \u003cdependencies\u003e\n        ...\n        \u003c!-- Capa's core SDK with all features. --\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003egroup.rxcloud\u003c/groupId\u003e\n            \u003cartifactId\u003ecapa-sdk-spi-demo\u003c/artifactId\u003e\n            \u003cversion\u003e1.0.7.RELEASE\u003c/version\u003e\n        \u003c/dependency\u003e\n        ...\n    \u003c/dependencies\u003e\n    ...\n\u003c/project\u003e\n```\n\n### Running the examples\n\nTry the following examples to learn more about Capa's Java SDK:\n\n* [capa-demo](https://github.com/reactivegroup/capa/tree/master/sdk-spi-demo)\n* [capa-aws](https://github.com/reactivegroup/capa-aws)\n* [capa-alibaba](https://github.com/reactivegroup/capa-alibaba)\n\n### Low retrofit cost migration\n\nIf you want to use the native Capa API, your legacy system needs to face a large refactoring workload.\n\nIn order to make the migration low-cost, we can reuse the middleware API currently used.\n\nBy developing an adaptation layer project (providing the same annotation/interface call method), the implementation of the original middleware API is changed to Capa API.\n\nIn this way, the application only needs to change a few code (such as changing the path name of the annotation/interface) to migrate to the Capa architecture.\n\nFor discussion of this issue, please see:\n\n[Java sdk design 调研：能否复用业界已有的事实标准](https://github.com/mosn/layotto/issues/206)\n\n[Capa API adapted to spring annotation.](https://github.com/reactivegroup/sigs/issues/16)\n\n[遗留中间件SDK无感迁移到Capa.](https://github.com/reactivegroup/sigs/issues/18)\n\n## Develop\n\n#### Reactor API\n\nTaking into account the asynchronous call mode and the use of non-blocking IO, we provide the Reactor programming model natively. You can also use the synchronous call function through its `block()` method.\n\nThe Java SDK for Capa is built using [Project Reactor](https://projectreactor.io/). It provides an asynchronous API for\nJava. When consuming a result is consumed synchronously, as in the examples referenced above, the `block()` method is\nused.\n\nThe code below does not make any API call, it simply returns\nthe [Mono](https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Mono.html) publisher object. Nothing\nhappens until the application subscribes or blocks on the result:\n\n```java\nMono\u003cString\u003e result=capaRpcClient.invokeMethod(SERVICE_APP_ID,\"say\",\"hello\",HttpExtension.POST,null,TypeRef.STRING);\n```\n\nTo start execution and receive the result object synchronously, use `block()`. The code below shows how to execute the\ncall and consume an empty response:\n\n```java\nMono\u003cString\u003e result=capaRpcClient.invokeMethod(SERVICE_APP_ID,\"say\",\"hello\",HttpExtension.POST,null,TypeRef.STRING);\n        String response=result.block();\n```\n\n#### Exception handling\n\nMost exceptions thrown from the SDK are instances of `CapaException`. `CapaException` extends from `RuntimeException`,\nmaking it compatible with Project Reactor.\n\n## Future\n\n### Multi-Runtime\n\n[Multi-Runtime 2022：待解决的问题](https://zhuanlan.zhihu.com/p/435012312?utm_source=wechat_session\u0026utm_medium=social\u0026utm_oi=618742049890111488\u0026utm_content=group2_article\u0026utm_campaign=shareopn)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapa-cloud%2Fcapa-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapa-cloud%2Fcapa-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapa-cloud%2Fcapa-java/lists"}