博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
springCloud分布式事务实战(一)案例需求及实现步骤
阅读量:3935 次
发布时间:2019-05-23

本文共 318 字,大约阅读时间需要 1 分钟。

本文不对分布式事务原理进行探索,而是通过一个案例来说明如何使用分布式事务 

案例需求:
创建2个基于springCloud的微服务,分别访问不同的数据库;然后创建一个整合服务,调用微服务实现数据的保存到2个不同的数据库,要求采用分布式事务,要么都成功,要么都失败。
案例拓扑图:

1470521-20190623133118125-944652565.pnguploading.4e448015.gif转存失败

 

 

实现步骤:

1 分布式事务处理器的编译和安装
Redis 安装 
注册中心编写
分布式事务服务器安装 
测试
2 数据库准备及2个微服务的编写与测试。
准备数据库
编写微服务1和2
注册到注册中心 
测试

3 整合分布式处理

服务整合:在微服务1 创建一个整合函数,访问微服务1和微服务2 
改造微服务1 参与分布式事务
改造微服务2 参与分布式事务
测试

 

转载地址:http://flhgn.baihongyu.com/

你可能感兴趣的文章
Projective Dynamics: Fusing Constraint Projections for Fast Simulation
查看>>
从2D恢复出3D的数据
查看>>
glm 中 数据类型 与 原始数据(c++ 数组)之间的转换
查看>>
Derivatives of scalars, vector functions and matrices
查看>>
the jacobian matrix and the gradient matrix
查看>>
VS2010 将背景设为保护色
查看>>
ubutun里面用命令行安装软件
查看>>
ubuntu 常用命令
查看>>
SQLite Tutorial 4 : How to export SQLite file into CSV or Excel file
查看>>
how to move pivot to origin
查看>>
Optimizate objective function in matrix
查看>>
Convert polygon faces to triangles or quadrangles
查看>>
How do I divide matrix elements by column sums in MATLAB?
查看>>
read obj in matlab
查看>>
find out the neighbour matrix of a mesh
查看>>
Operators and special characters in matlab
查看>>
As-Conformal-As-Possible Surface Registration
查看>>
qmake Variable Reference
查看>>
Lesson 2 Gradient Desent
查看>>
find border vertex
查看>>