Skip to content

Whitilied/play-slick-seata

Repository files navigation

This project is POC for, playframework with seata.

Use distributed transaction services under a microservices architecture

Quick Start

  • start infrastructure(mysql, seata-server and maxwell), by docker compose
docker-compose up -d
  • prepare mysql DML

entry mysql cli (password is empty)

docker exec -it mysql mysql -uroot

exec sql script in play-slick-seata-sample/conf/sql/init_db.sql

  • watch mysql binlog by maxwell
docker logs -f maxwell
  • start play sample program
sbt "project play-slick-seata-sample" run
  • test success request
curl -X POST \
  http://localhost:9500/order/placeOrder \
  -H 'Content-Type: application/json' \
  -d '{
    "userId": 1,
    "productId": 1,
    "price": 1
}'
  • test illegal request (user balance not enough)
curl -X POST \
  http://localhost:9500/order/placeOrder \
  -H 'Content-Type: application/json' \
  -d '{
    "userId": 1,
    "productId": 1,
    "price": 100
}'

Others

About Seata

About

distributed transaction with playframework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages