Distributed Transaction Manager DTM
5/14/25About 1 mincomponentdtmdistributedtransaction
DTM Usage Example
The sponge framework deeply integrates the DTM distributed transaction manager. Below are examples of using DTM in services created by sponge:
web service
gRPC service
Configuration Guide
Sponge natively supports the DTM driver and is compatible with mainstream service discovery components:
Supported Service Registries:
- Consul
- Etcd
- Nacos
Configuration Example (using Etcd for a gRPC service):
app:
registryDiscoveryType: "etcd" # Registry and discovery type: consul, etcd, nacos. If empty, disables registry and discovery.
grpcClient:
- name: "dtmservice" # DTM service name
registryDiscoveryType: "etcd" # Registry and discovery type: consul, etcd, nacos. If empty, this field is ignored if registry and discovery are enabled.
host: "127.0.0.1" # DTM service IP or domain name. If registry and discovery are enabled, this field is ignored.
port: 36790 # DTM service gRPC port. If registry and discovery are enabled, this field is ignored.
etcd:
addrs: ["127.0.0.1:2379"]