This repository has been archived by the owner on Oct 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 435
使用go客户端连接servicecomb,有时候会报错 #548
Comments
我也有同样问题;另外,项目首页推荐的golang客户端一次都没更新过,官方有计划发布golang客户端吗?非常感谢 |
刚刚在golang客户端 repo里面创建了一个问题。 |
很抱歉,由于目前在忙别的工作,确实很久没有更新该client库了。
从上述报错信息来看,应该是使用 你也可以按以下指引先跑一遍测试用例看看 # 克隆并编译servicecomb-pack项目
$ git clone https://github.com/apache/servicecomb-pack.git
$ cd servicecomb-pack
$ mvn clean install -P 'mysql,!docker' -DskipTests=true
# 初始化alpha-server依赖的数据库
$ mysql -uroot -proot -h127.0.0.1 -P3306
MariaDB [(none)]> create database saga;
Query OK, 1 row affected (0.005 sec)
MariaDB [(none)]> grant all privileges on saga.* to saga@'localhost' identified by 'saga';
Query OK, 0 rows affected (0.045 sec)
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> use saga
Database changed
MariaDB [saga]> source alpha/alpha-server/src/main/resources/schema-mysql.sql
MariaDB [saga]> exit
Bye
# 启动alpha-server
$ java -Dspring.profiles.active=mysql -D"spring.datasource.url=jdbc:mysql://127.0.0.1:3306/saga?useSSL=false" -D"spring.datasource.password=saga" -jar alpha/alpha-server/target/saga/alpha-server-0.6.0-SNAPSHOT-exec.jar 另开一个shell终端,执行以下命令: # 克隆matrix-go-client项目并切换工作目录至matrix-saga-go目录
$ git clone https://github.com/jeremyxu2010/matrix-saga-go.git
$ cd matrix-saga-go
# 使用go mod下载go module依赖
$ go mod download
# 运行测试用例,可以看到转帐过程中,foo和bar的帐户余额出现了短暂的不一致,但后面又达到了最终一致性,符合saga分布式事务的设计理念
$ go run test/sagatx_demo.go
foo balance: 500, bar balance: 500
foo balance: 400, bar balance: 500
foo balance: 500, bar balance: 500
foo balance: 500, bar balance: 500
...... 这个go client库是一年前做的,当时 |
Just close this issue as we already show the solution here. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
日志如下
The text was updated successfully, but these errors were encountered: