{"id":38963533,"url":"https://github.com/stun4j/stun4j-stf","last_synced_at":"2026-01-17T16:27:01.194Z","repository":{"id":40449258,"uuid":"476157963","full_name":"stun4j/stun4j-stf","owner":"stun4j","description":"Flexible transaction framework, orchestration mechanism, delay queue, adaptive batch processing, async task chain with lineage, compensatory workflow, distributed, high performance, easy to use","archived":false,"fork":false,"pushed_at":"2023-02-26T00:45:11.000Z","size":773,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-05T00:47:12.344Z","etag":null,"topics":["adaptive","async-task","base-theorem","batch-processing","delay-queue","distributed","dsl","high-availability","high-performance","high-reliability","horizontal-scalable","lightweight","lineage","orchestration","responsive","retry-library","transaction","workflow"],"latest_commit_sha":null,"homepage":"","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/stun4j.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}},"created_at":"2022-03-31T05:05:05.000Z","updated_at":"2024-01-12T18:28:53.000Z","dependencies_parsed_at":"2023-02-17T12:15:58.720Z","dependency_job_id":null,"html_url":"https://github.com/stun4j/stun4j-stf","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/stun4j/stun4j-stf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stun4j%2Fstun4j-stf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stun4j%2Fstun4j-stf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stun4j%2Fstun4j-stf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stun4j%2Fstun4j-stf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stun4j","download_url":"https://codeload.github.com/stun4j/stun4j-stf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stun4j%2Fstun4j-stf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28511864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"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":["adaptive","async-task","base-theorem","batch-processing","delay-queue","distributed","dsl","high-availability","high-performance","high-reliability","horizontal-scalable","lightweight","lineage","orchestration","responsive","retry-library","transaction","workflow"],"created_at":"2026-01-17T16:27:01.106Z","updated_at":"2026-01-17T16:27:01.171Z","avatar_url":"https://github.com/stun4j.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stun4J Stf\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n### 柔性事务、延时队列、可编排、自适应批处理、异步任务链、分布式、极简设计、高可用、高性能、易于使用\n| 稳定版 | 主要变动 | 发布日期 |\n| ------------- | ------------- | ------------|\n| 1.1.0 | 引擎重构和优化、支持state的二进制存储和压缩、支持Core和DelayQueue的数据源分离 | 2023/02/19 |\n| 1.0.1 | 兼容较低版本的Spring | 2022/06/06 |\n| 1.0.0 | 初版发布 | 2022/06/03 |\n## 功能特性\n* 柔性事务，基于BASE理论，以本地事务为基石，无惧任何失败（超时、宕机、异常等等）\n* 延时队列，支持秒级时间精度，高吞吐，良好的水平伸缩性\n* 补偿式迷你工作流，简约的DSL编排，主控权依然握于开发者手中\n* 自适应、响应式的批处理机制，天然背压，内置监控\n* 良好的梯度重试机制\n* 支持可靠的、具备血缘关系的异步任务链\n* 极简设计，分布式仅依赖DB，无注册中心强需求、高可用、高可靠，无状态、无Leader\n* 开箱支持MySQL、PostgreSQL、Oracle三大主流关系型数据库\n* 制品为袖珍型jar包，易于使用集成，亦可独立部署\n\n## 如何获取\n### 方式1：从Maven中央仓库获取\n在你工程的**pom.xml**中加入如下片段，即可从maven中央仓库获取：\n\n#### 获取专属的**spring-boot-starter**，便于在spring-boot工程中使用\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.stun4j.boot\u003c/groupId\u003e\n  \u003cartifactId\u003estun4j-stf-spring-boot-starter\u003c/artifactId\u003e\n  \u003cversion\u003e1.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n#### 或者\n#### 获取**核心库**，直接使用\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.stun4j\u003c/groupId\u003e\n  \u003cartifactId\u003estun4j-stf-core\u003c/artifactId\u003e\n  \u003cversion\u003e1.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n### 方式2：通过源码构建\n切到项目根目录，在控制台执行如下maven命令：\n```shell\n$ mvn clean package -Dmaven.test.skip=true\n```\n构建完成后，会在各自的target目录中生成`stun4j-stf-core-\u003cversion\u003e.jar`和`stun4j-stf-spring-boot-starter-\u003cversion\u003e.jar`，放入你工程的classpath即可。spring-boot工程仅需要`boot-starter`这个jar（`stun4j-stf-boot-sample`工程提供了具体示例），如果你希望通过low-level api的方式来使用Stf，那么你可以了解并使用`core`这个jar。\n\n## 如何使用\n### [**Sample**如何使用](stun4j-stf-sample/stun4j-stf-boot-sample/README.md)\n### [专属的**spring-boot-starter**如何使用](stun4j-stf-spring-boot-starter/README.md)\n### [**补偿式工作流**如何使用](stun4j-stf-core/README.md)\n\n## 核心图解\n### 基本原理\n![fundamental](https://user-images.githubusercontent.com/24976735/170415176-cb1b92c6-a4e9-414d-9ac0-96e0a73d65b6.png)\n### 水平伸缩和高可用\n![sha](https://user-images.githubusercontent.com/24976735/170385763-0118e324-4f6d-47da-968d-29fbea7f79fa.png)\n### 补偿式工作流\n```yml\nstfs {\n  local-vars {\n    dp = com.stun4j.stf.sample.domain\n  }\n  actions {\n    acceptReq {\n      args = [{use-in:{class:${dp}.Req}}]\n    }\n    step1Tx {\n      args = [{invoke-on-in:{method:getId, class:Long}}, {invoke-on-in:{method:getReqId, class:String}}]\n    }\n    step2Tx {\n      args = [{use-in:{class:${dp}.Tx}}]\n    }\n    endTx {\n      args = [{use-in:{class:${dp}.Tx}}]\n    }\n    sendNotification {\n      oid = bizApp\n      args = [{use-in:{class:String}}]\n      timeout = 10s\n    }\n  }\n  forwards {\n    acceptReq.to = step1Tx\n    step1Tx.to = step2Tx\n    step2Tx.to = endTx\n    endTx.to = sendNotification\n  }\n}\n```\n\n## 参与\n* 报告bugs、给到建议反馈，请提交一个[issue](https://github.com/stun4j/stun4j-stf/issues/new)\n* 参与贡献 改进或新功能，请提交pull request并创建一个[issue](https://github.com/stun4j/stun4j-stf/issues/new)以便讨论与进度追踪\n* 不吝赐 :star2:\n\n## 感谢\n*  异步任务链使用了transmittable-thread-local这个[项目](https://github.com/alibaba/transmittable-thread-local)\n\n## 开源许可协议\n本项目采用 **Apache Software License, Version 2.0**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstun4j%2Fstun4j-stf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstun4j%2Fstun4j-stf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstun4j%2Fstun4j-stf/lists"}