package com.huxiaoxin.model.com.huxiaoxin.api;
import com.huxiaoxin.feigner.AFeigner;
import com.huxiaoxin.feigner.BFeigner;
import com.huxiaoxin.feigner.CFeigner;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.text.SimpleDateFormat;
import java.util.Calendar;
/**
* @author 胡晓欣
* @date 2019-11-27 16:27
*/
@Controller
@RequestMapping("/seata")
public class SeataControllerApi {
@Autowired
public AFeigner aFeigner;
@Autowired
public BFeigner bFeigner;
@Autowired
public CFeigner cFeigner;
@Autowired
public SeataService seataService;
@RequestMapping()
@GlobalTransactional
@ResponseBody
public String index() throws Exception {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
aFeigner.index("seata在调用A!" + dateFormat.format(Calendar.getInstance().getTime()));
bFeigner.index("seata在调用B!" + dateFormat.format(Calendar.getInstance().getTime()));
cFeigner.index("seata在调用C!" + dateFormat.format(Calendar.getInstance().getTime()));
return "SUCCESS";
}
@RequestMapping("/service")
@GlobalTransactional
@ResponseBody
public String service() throws Exception {
seataService.execSeata("");
return "SUCCESS";
}
@RequestMapping("/back")
@GlobalTransactional
@ResponseBody
public String back() throws Exception {
seataService.execBaxk("");
return "SUCCESS";
}
@RequestMapping("/back1")
@GlobalTransactional
@ResponseBody
public String back1() throws Exception {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
aFeigner.index("seata在调用A!" + dateFormat.format(Calendar.getInstance().getTime()));
bFeigner.index("seata在调用B!" + dateFormat.format(Calendar.getInstance().getTime()));
cFeigner.index("error");
return "SUCCESS";
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
Spring Cloud微服务事务处理Demo
共273个文件
xml:177个
java:25个
class:25个
需积分: 50 18 下载量 59 浏览量
2019-12-28
16:23:17
上传
评论
收藏 139KB RAR 举报
温馨提示
使用Spring Cloud微服务架构 阿里巴巴开源Seate处理分布式程序事务一致性问题demo 使用IDEA开发
资源推荐
资源详情
资源评论
收起资源包目录
Spring Cloud微服务事务处理Demo (273个子文件)
SeataControllerApi.class 3KB
BControllerApi.class 2KB
SeataServiceImpl.class 2KB
Application.class 2KB
DataSourceProxyAutoConfiguration.class 1KB
CServiceImpl.class 1KB
BServiceImpl.class 1KB
AServiceImpl.class 1KB
BApplication.class 1KB
CApplication.class 1KB
AApplication.class 1KB
AControllerApi.class 950B
CControllerApi.class 948B
EurekaAppcation.class 772B
BFeigner.class 691B
BFeignerFallback.class 668B
CFeigner.class 588B
AFeigner.class 588B
AFeignerFallback.class 521B
CFeignerFallback.class 521B
Test.class 275B
SeataService.class 264B
CService.class 203B
BService.class 203B
AService.class 203B
file.conf 2KB
file.conf 2KB
file.conf 2KB
file.conf 2KB
file.conf 2KB
file.conf 2KB
file.conf 2KB
file.conf 2KB
registry.conf 195B
registry.conf 195B
registry.conf 195B
registry.conf 195B
registry.conf 195B
registry.conf 195B
registry.conf 195B
registry.conf 195B
tcc-seata.iml 15KB
b-provider.iml 15KB
c-provider.iml 15KB
a-provider.iml 15KB
hxx-eureka.iml 14KB
hxx-feigner.iml 6KB
hxx-common.iml 6KB
hxx-tcc.iml 830B
SeataControllerApi.java 2KB
BControllerApi.java 2KB
SeataServiceImpl.java 2KB
DataSourceProxyAutoConfiguration.java 1KB
Application.java 1KB
BApplication.java 925B
CServiceImpl.java 898B
AServiceImpl.java 898B
CApplication.java 897B
BServiceImpl.java 890B
BFeigner.java 710B
AApplication.java 706B
AControllerApi.java 574B
CControllerApi.java 573B
AFeigner.java 542B
CFeigner.java 542B
EurekaAppcation.java 407B
BFeignerFallback.java 340B
SeataService.java 258B
CFeignerFallback.java 205B
AFeignerFallback.java 205B
CService.java 175B
BService.java 175B
AService.java 175B
Test.java 114B
inputFiles.lst 567B
inputFiles.lst 411B
inputFiles.lst 334B
inputFiles.lst 334B
inputFiles.lst 334B
createdFiles.lst 223B
createdFiles.lst 142B
createdFiles.lst 142B
createdFiles.lst 142B
inputFiles.lst 108B
createdFiles.lst 0B
createdFiles.lst 0B
workspace.xml 62KB
uiDesigner.xml 9KB
pom.xml 2KB
pom.xml 2KB
pom.xml 2KB
pom.xml 2KB
pom.xml 2KB
pom.xml 2KB
Project_Default.xml 1KB
compiler.xml 1KB
pom.xml 1KB
modules.xml 1KB
Maven__org_springframework_cloud_spring_cloud_starter_netflix_eureka_client_2_1_3_RELEASE.xml 857B
Maven__org_springframework_cloud_spring_cloud_starter_netflix_eureka_server_2_1_3_RELEASE.xml 857B
共 273 条
- 1
- 2
- 3
资源评论
阿尔卑斯的哭泣
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- ZArchiver.Pro_0.9.5.apk
- vmware环境配置.mp4
- 548springboot + vue 大学生社团活动平台.zip(可运行源码+数据库文件+文档)
- 微信小程序 辩论倒计时小程序源码 作业设计demo 计算机专业参考
- 深入探究文件IO,嵌入式Linux
- 微信备忘录小程序源码 作业设计demo 计算机专业作业
- 微信小程序 仿百度小说小程序 看小说小程序 实现源码
- 锂电资料包-锂离子电池技术干货资料合集.zip
- EMC EMI资料大全电磁兼容电磁干扰设计资料工程师必备经验资料35个合集.zip
- 547springboot + vue 交流互动系统.zip(可运行源码+数据库文件+文档)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功