Apache Seata is an open source distributed transaction manager originally from Alibaba, now part of the Apache Incubator. It solves the problem of maintaining atomicity across multiple microservices that each have their own database. The setup involves running a Seata Server as a transaction coordinator (via Docker), adding the seata-spring-boot-starter dependency, configuring seata.conf and application.properties, and creating an undo_log table for AT mode. The @GlobalTransactional annotation marks the start of a distributed transaction. For Spring Boot, XID propagation between services requires a custom ClientHttpRequestInterceptor for outbound calls and a servlet filter for inbound calls. Spring Cloud simplifies this by handling most propagation automatically, though RestClient and WebClient still need manual configuration.

10m read timeFrom feeds.feedblitz.com
Post cover image
Table of contents
1. Introduction2. Why Distributed Transactions?3. What Is Apache Seata?4. Seata Server5. Using Spring Boot6. Using Spring Cloud7. Summary

Sort: