seata_go

command module
v0.0.0-...-d739c15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

README

Kitex with Seata-go example

This example uses the use case from the Seata official documentation to demonstrate how to use Seata-go in Kitex.

How To Run

Basic environment

Ensure Docker has been installed.

cd dockercompose
docker-compose up -d
Run all servers
go run ./service/account
go run ./service/storage
go run ./service/order
Run main program
go run main.go

Basic Principle

By leveraging Kitex's capability to transmit metainfo between services, the XID assigned by Seata to each transaction can be propagated to each service. This XID can then be used to link the entire transaction.

In this example, Kitex middleware is used to automatically propagate the XID. Please refer to seata-go.go.

NODE: Must use the underlying transport protocol that supports passthrough of meta information

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
kitex_gen
account/accountservice
Code generated by Kitex v0.9.1.
Code generated by Kitex v0.9.1.
order/orderservice
Code generated by Kitex v0.9.1.
Code generated by Kitex v0.9.1.
storage/storageservice
Code generated by Kitex v0.9.1.
Code generated by Kitex v0.9.1.
service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL