Skip to main content

Components Overview

Components under src/component/ all follow a "service + client SDK + protocol" trio pattern; a business service simply links the corresponding SDK to use it.

ComponentServiceSDKDescription
dtmqdtmq-proxysvrdtmq-proxy-sdk / dtmq-common-sdkDistributed message queue: channel subscription, message send/receive, WAL master-slave replication
distributed_transactiondtcoordsvrsdk/Distributed transaction (2PC): coordinator + participator/initiator handles
rankrank_board_svrsdk/Rank board: sharded boards, mirrors, WAL master-standby sync
orbitcontroller / agentFour SDKsOrbit scheduling framework (controller/agent/server/client)

Additionally:

  • GameSharedComponent/: shared pure algorithm libraries for games (BattleUtility random numbers, ItemAlgorithm inventory slot algorithms, Orbit client-side runtime), with no standalone process;
  • component/test/: component unit tests (ItemAlgorithmTest, etc.).

Common Component Structure

component/<name>/
├── protocol/ # Component protocol (pbdesc + config)
├── <name>-*svr/ # Service implementation (task action + data layer)
├── sdk/ # Client SDK (generated caller stubs + wrapped APIs)
└── CMakeLists.txt # Protocol target and RPC generation rules

The service's RPC handlers and task action skeletons are generated by Mako templates; the SDK contains the generated caller-side code (*svrservice.atfw.gen.*) plus hand-wrapped, easy-to-use APIs.

Current Business Adoption

  • lobbysvr has integrated dtmq (logic/dtmq/task_action_channel_event_sync.* receives the channel event stream, typically used for chat channel delivery) and rank (rank/ rank board queries);
  • rank_settlement_svr works with the rank component for periodic settlement;
  • orbitsvr demonstrates the orbit component's server/client RPC.