RepoPilot

How do their APIs compare?

About codingapi/tx-lcn · 2 messages · last activity 9/6/2026

Question

How do their APIs compare?

RepoPilot

These two projects have fundamentally different API philosophies, reflecting their different problem domains — one is an internal RPC-style protocol for coordinating distributed transactions, the other is a full HTTP/JSON open API for job orchestration.

tx-lcn: internal event/message-driven protocol

tx-lcn's "API" isn't a typical REST surface aimed at end users — it's an internal client-to-manager messaging protocol used by the TC (transaction client) to talk to the TM (transaction manager). The pattern is consistent across the transaction lifecycle:

  • Create: TransactionStepCreate.run() sends a TransactionCreateEvent via managerProtocoler.requestMsg(...) to start a transaction group, and throws TxException if the TM doesn't respond [txlcn-tc/src/main/java/com/codingapi/txlcn/tc/control/step/TransactionStepCreate.java:L29-L37].
  • Join: TransactionStepJoin.run() sends a TransactionJoinEvent to attach a participant to the group, then asynchronously blocks on a Lock waiting for the TM's commit/rollback decision via executeJoin() [txlcn-tc/src/main/java/com/codingapi/txlcn/tc/control/step/TransactionStepJoin.java:L50-L94].
  • Notify: TransactionStepNotify.run() reports the local execution result back with a TransactionNotifyEvent, retrying if the TM hasn't replied yet, then commits or rolls back locally based on the response [txlcn-tc/src/main/java/com/codingapi/txlcn/tc/control/step/TransactionStepNotify.java:L32-L52].

These are all implementations of a common TransactionStep interface, keyed by a TransactionState enum (CREATE/JOIN/NOTIFY), and driven over a custom binary/socket protocol configured via TM host:port addresses in TxConfig (tms, txManagerAddresses()) [txlcn-tc/src/main/java/com/codingapi/txlcn/tc/config/TxConfig.java:L49-L52,L67-L76]. There's no public HTTP contract here — it's a purpose-built RPC protocol (txlcn-protocol module) for transaction coordination, not something external clients or third parties call directly.

xxl-job: explicit HTTP/JSON open API

xxl-job, by contrast, exposes a genuine external-facing API meant for other systems to integrate with. OpenApiController.api() is a single HTTP endpoint (/api/{uri}) that dispatches by a uri path variable to distinct operations — callback, registry, registryRemove, addJob, updateJob, removeJob, startJob, stopJob, triggerJob — each deserializing a JSON request body into a typed request object (e.g. JobAddRequest, JobTriggerRequest) and delegating to AdminBiz or AdminJobBiz [xxl-job-admin/src/main/java/com/xxl/job/admin/business/scheduler/openapi/OpenApiController.java:L38-L106]. It authenticates via accessToken + appname headers checked against a registered XxlJobGroup's token [xxl-job-admin/src/main/java/com/xxl/job/admin/business/scheduler/openapi/OpenApiController.java:L47-L53].

Alongside this open API, xxl-job also has a conventional admin-console REST layer for the web UI itself, e.g. JobInfoController (/stop, /start, /trigger endpoints gated by session login via XxlSsoHelper.loginCheckWithAttr) [xxl-job-admin/src/main/java/com/xxl/job/admin/business/controller/JobInfoController.java:L133-L157] and JobCodeController.save() for editing GLUE job source code with input validation (blank/length/XSS checks) [xxl-job-admin/src/main/java/com/xxl/job/admin/business/controller/JobCodeController.java:L64-L100].

Summary of the contrast

Aspecttx-lcnxxl-job
AudienceInternal TC↔TM coordination onlyExternal systems (open API) + admin UI
TransportCustom socket protoc

Want to ask your own question?

Open chat for codingapi/tx-lcn

Public Q&A. Generated by RepoPilot from the actual source of codingapi/tx-lcn. AI answers can be incomplete or stale — verify before relying on them.