{"id":14973961,"url":"https://github.com/xingcun/xc-spring-cloud-alibaba","last_synced_at":"2025-04-09T15:09:15.401Z","repository":{"id":37170098,"uuid":"179462389","full_name":"xingcun/xc-spring-cloud-alibaba","owner":"xingcun","description":"spring cloud alibaba(2.2.1最新版)+nacos+dubbo+gateWay+sentinel+rocketmq+(pgsql/mysql8.0的json支持)+ignite集成可用于docker分布式框架+分布式自动化任务+mybatis多数据源+seate+ shardingSphere分布式分库事务解决方案","archived":false,"fork":false,"pushed_at":"2022-09-08T01:01:04.000Z","size":1621,"stargazers_count":225,"open_issues_count":11,"forks_count":92,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-09T15:09:08.524Z","etag":null,"topics":["dubbo","gateway","hystrix","ignite","mybatis","mybatis-plus","mysql8","nacos","pgsql","quartz","rocketmq","seate","sentinel","sentinel-1","shardingsphere","shardingsphere-jdbc","spring-boot","spring-cloud","springboot","springcloud"],"latest_commit_sha":null,"homepage":"http://62.234.130.188","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/xingcun.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}},"created_at":"2019-04-04T09:08:27.000Z","updated_at":"2025-01-23T00:54:21.000Z","dependencies_parsed_at":"2023-01-17T14:02:06.727Z","dependency_job_id":null,"html_url":"https://github.com/xingcun/xc-spring-cloud-alibaba","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xingcun%2Fxc-spring-cloud-alibaba","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xingcun%2Fxc-spring-cloud-alibaba/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xingcun%2Fxc-spring-cloud-alibaba/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xingcun%2Fxc-spring-cloud-alibaba/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xingcun","download_url":"https://codeload.github.com/xingcun/xc-spring-cloud-alibaba/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248055282,"owners_count":21040157,"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":["dubbo","gateway","hystrix","ignite","mybatis","mybatis-plus","mysql8","nacos","pgsql","quartz","rocketmq","seate","sentinel","sentinel-1","shardingsphere","shardingsphere-jdbc","spring-boot","spring-cloud","springboot","springcloud"],"created_at":"2024-09-24T13:49:44.811Z","updated_at":"2025-04-09T15:09:15.376Z","avatar_url":"https://github.com/xingcun.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# spring-cloud-alibaba-by-xc\nspring cloud alibaba集成框架可应用于docker部署\n已更新集成阿里spring cloud 2.2.1.RELEASE版\n\nspring cloud更新为Hoxton.SR8版本\n\ndubbo2.7.8\n\nps:已将相对应框架升级为最新版本\n\n演示demo:\u003ca href=\"https://yangxingcun.com\" target=\"_blank\"\u003ehttp://62.234.130.188\u003c/a\u003e\nsentinel帐号密码为sentinel\nnacos 帐号密码为nacos\n\n| package name | remark |\n| ------------ |:-----:|\n|xc-service|用于数据库连接，提供service impl类|\n|xc-admin|用于提示api连接，提供control类|\n|xc-api|用于提供接口信息，和一些共同的实体类|\n|xc-common|用于提供一些公共库|\n|xc-gate|网关,分配路由,用于调用admin类的control层,无需关注端口，路由分配转发|\n|xc-ui|后台页面,使用\u003ca href=\"https://pro.ant.design/index-cn\" target=\"_blank\"\u003eant design pro V4\u003c/a\u003e react技术开发|\n|\u003ca href=\"https://github.com/xingcun/xc-spring-cloud-alibaba/blob/master/ht-project\" target=\"_blank\"\u003eht-project\u003c/a\u003e|增加mybatis多数据源操作,引用seate1.2处理分布式事务,多数据源事务,引用shardingSphere进行分库分表处理|\n\n# 项目布署图\n![xc-project-deploy](https://user-images.githubusercontent.com/14237778/57747392-02af5700-7708-11e9-8542-9de2fd9a57ce.png)\n\n\n\n# What does it do\n本框架使用spring cloud为基本架构，结合阿里dubbo+nacos提供服务层\n\n再结合hibernate+pgsql+jpa为数据库连接层\n\n以ignite强大的缓存能力为hibernate提供L1,L2缓存\n\n整合分布式同步锁\n\n整合消息队列bus event与stream，使用robotMq进行通讯\n\n整合sentinel限流,有sentinel+dubbo+gate\n\n微服务全新架构，整合阿里系的主流架构应用,完全适用于各大主流业务开发  \n\n\n![](https://user-images.githubusercontent.com/14237778/60095561-673ae880-9781-11e9-9f05-fb7d04d1a75d.png)\n![cbc4674336c196da17a8f1716b6d39b](https://user-images.githubusercontent.com/14237778/60095634-9b160e00-9781-11e9-8d83-c928ca4f6a9e.png)\n)\n![企业微信截图_15625886397651](https://user-images.githubusercontent.com/14237778/60810018-b0962980-a1be-11e9-93f1-d788ea6bfd04.png)\n![56a150f482970b8dc1ab8625ac5c79c](https://user-images.githubusercontent.com/14237778/60096038-930a9e00-9782-11e9-8a60-957a607c6871.png)\n\n\n\n# Start project\n\n* **先启动nacos，使用的是1.2版的,请自行到\u003ca href=\"https://github.com/alibaba/nacos/releases\" target=\"_blank\"\u003enacos官网下载\u003c/a\u003e使用**\n* **再启动xc-service中的XcServiceBootstrap**\n* **再启动xc-admin中的XcAdminBootstrap**\n* **再启动xc-gate中的GateBootstrap**\n* **配置nginx,配置文件参考\u003ca href=\"https://github.com/xingcun/xc-spring-cloud-alibaba/tree/master/xc-ui/docker/nginx.conf\" target=\"_blank\"\u003enginx.conf\u003c/a\u003e,启动前端文件**\n* **增加Mysql8.0并支持json操作,修改xc-service中的application.yml数据库配置，再修改BaseEntity，User类**\n\n# 注意事项\n\u003e * 数据库配置文件在xc-service中的application.yml配置文件，引用的是pgsql+hibernate，框架解决了pgsql中的jsonb实例化问题，如需引用其它数据库，请自行更改（最简单的方案就是去除json引用，增加pom数据库引用包）\n\u003e * 数据库配置连接上，直接启动就会自动建表\n\u003e * 127.0.0.1:8880/api/admin/user/login?username=xx\u0026password=xx 登录,获取token后放在header请求中,xc-token=xxxxxxxxxxxx\n\u003e * 如需使用sentinel做监听，可打开xc-service配置文件application.yml中的 sentinel.transport.dashboard,  自行到官网下载,\u003ca href=\"https://github.com/alibaba/Sentinel/releases\" target=\"_blank\"\u003esentinel1.7.0\u003c/a\u003e\t启动命令 java -Dserver.port=8088 -Dcsp.sentinel.dashboard.server=localhost:8088 -Dproject.name=sentinel-dashboard -jar sentinel-dashboard-1.7.0.jar\n\n# 自动化任务使用说明\n* **在xc-service中的resources中,有quartz_innodb.sql(mysql),另一份是有quartz_innodb_pgsql.sql(pgsql)使用的初始化数据库文件**\n* **在xc-service中使用job,直接实现接口BaseQuartzJob,并注入到spring bean管理,可使用@Component等方式实现**\n* **在xc-admin中使用job,与xc-service相同,然后需有control继承BaseQuartzControl用于远程调度使用,或者可自行实现接收接口**\n* **配置参数说明**\n\n| 参数名 | remark |\n| ------------ |:-----:|\n| name |任务名称|\n| cron |cron表达式|\n| startDate |运行时间，如果存在，即cron失效|\n| isLocalProject |是否xc-service本地运行job|\n| url |如果isLocalProject=true,url为空，否则需填入接收任务运行的接口地址,可以直接填xc-admin、或者是http://127.0.0.1/xxxxxxx|\n| runJobClass |运行job的class,必须是直接实现接口BaseQuartzJob|\n|param|运行时所需要的参数(json)|\n|state|0为暂停,1为开始|\n|description|任务描述|\n\n\n\n\n\n在nacos配置上自行增加名为dubbo-sentinel-json的配置即可实现限流\n```\n[\n\n   {\n    \"resource\": \"com.xc.service.user.UserService\",\n    \"count\": 1,\n    \"controlBehavior\":2\n  }\n  \n]\n```\n\n\n\n在nacos配置上自行增加名为gate-sentinel-json的配置即可实现限流\n```\n[\n\n   {\n    \"resource\": \"xc-admin\",\n    \"count\": 1,\n    \"intervalSec\":1\n  },\n   {\n    \"resource\": \"aliyun_route\",\n    \"count\": 1,\n    \"intervalSec\":1\n  }\n  \n]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxingcun%2Fxc-spring-cloud-alibaba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxingcun%2Fxc-spring-cloud-alibaba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxingcun%2Fxc-spring-cloud-alibaba/lists"}