Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Spring Cloud Alibaba + Nacos + Dubbo + OpenFeign + Sentinel + Seata 整合示例 (跟进Spring Cloud Alibaba最新版本)

Notifications You must be signed in to change notification settings

sharionlee/spring-cloud-alibaba-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

30 Commits

Repository files navigation

spring-cloud-alibaba-samples

一、准备环境

1、启动 Nacos server

Nacos Server 下载地址

下载最新版本Nacos Server, 本地启动Nacos

  • 进入nacos/bin目录,执行以下命令启动

    sh startup.sh -m standalone

    -m standalone 表示启动单机版nacos

  • 访问nacos控制台

    控制台地址:http://127.0.0.1:8848/nacos

    用户名密码:nacos/nacos

2、启动Seata Server

Seata Server 下载地址

下载最新版本Seata Server, 本地启动Seata

  • 进入seata/bin目录,执行以下命令启动seata-server

nohup sh seata-server.sh -m file &

  • 初始化业务数据库undo_log表
-- the table to store seata xid data
-- 0.7.0+ add context
-- you must to init this sql for you business databese. the seata server not need it.
-- 此脚本必须初始化在你当前的业务数据库中,用于AT 模式XID记录。与server端无关(注:业务数据库)
-- 注意此处0.3.0+ 增加唯一索引 ux_undo_log
drop table `undo_log`;
CREATE TABLE `undo_log` (
 `id` bigint(20) NOT NULL AUTO_INCREMENT,
 `branch_id` bigint(20) NOT NULL,
 `xid` varchar(100) NOT NULL,
 `context` varchar(128) NOT NULL,
 `rollback_info` longblob NOT NULL,
 `log_status` int(11) NOT NULL,
 `log_created` datetime NOT NULL,
 `log_modified` datetime NOT NULL,
 `ext` varchar(100) DEFAULT NULL,
 PRIMARY KEY (`id`),
 UNIQUE KEY `ux_undo_log` (`xid`,`branch_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

二、使用组件介绍

  • Nacos 注册中心
  • Nacos 配置中心
  • Dubbo RPC 服务调用
  • Open Feign REST 服务调用
  • Sentinel 限流熔断
  • Seata 分布式事务解决方案

三、项目目录介绍

  • sca-common
    项目公用模块(实体类,Dubbo Api等)
  • sca-customer 消费者
  • sca-provider 服务提供者

About

Spring Cloud Alibaba + Nacos + Dubbo + OpenFeign + Sentinel + Seata 整合示例 (跟进Spring Cloud Alibaba最新版本)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 93.4%
  • TSQL 6.6%

AltStyle によって変換されたページ (->オリジナル) /