#548·dtm

gozero 的 rpc 直接连接到 DTM,执行事务时出错

作者: linyu-senior创建于 2025年2月19日更新于 2026年1月27日

Here is the DTM configuration in the rpc microservice: `WalletRpcConf: Endpoints: - 127.0.0.1:2006 NonBlock: true` Here is the DTM configuration in Docker-compose: `dtm: image: yedf/dtm:latest container_name: dtm restart: always ports: - "36789:36789" # HTTP API port - "36790:36790" # gRPC port environment: IS_DOCKER: 1 STORE_DRIVER: Redis STORE_HOST: Redis # Using container name as host STORE_PORT: 6379 STORE_PASSWORD: G62m50oigInC30sf # Using the same password as your Redis service STORE_REDIS_DB: 0 # Redis database number networks: - saas_customer_system_net depends_on: - Redis` When executing transactions, I saw the following error log in the Docker container of DTM: `{"level":"error","ts":"2025-02-19T08:02:31.852Z","caller":"dtmsvr/trans_type_saga.go:133","msg":"exec branch 01 action direct:///127.0.0.1:2006/pb.Wallet/DeductBalance error: your http/grpc result should be specified as in:\nhttp://d.dtm.pub/practice/arch.html#proto\nunkown result will be retried: call dtmdriver.Use() before you use custom scheme for 'direct:///127.0.0.1:2006/pb.Wallet/DeductBalance'","stacktrace":"GitHub.com/dtm-labs/dtm/dtmsvr.(*transSagaProcessor).ProcessOnce.func3.1\n\t/app/dtm/dtmsvr/trans_type_saga.go:133\ngithub.com/dtm-labs/dtm/dtmsvr.(*transSagaProcessor).ProcessOnce.func3\n\t/app/dtm/dtmsvr/trans_type_saga.go:137"}` I am currently using the gozero framework, and I have configured DTM in Docker-compose as infrastructure, using the direct connection method. What is the reason for this? I could not find any information on this online.