Node.js and Go
The Go gateway answers as the Node.js gateway 4.3.30 does. A conformance harness checks it on 136 requests, and on the call events both write. The differences below are deliberate. The full list, with the pull request for each, is in the repository’s differences.
Before you switch
Section titled “Before you switch”Check these in the environment you move:
- Latest data schema. The Go gateway reads the current shape of each collection, never older shapes. From 4.4.32 it reads imperfect data with care: a malformed value that the Node.js gateway gives a definite meaning is read the same way; fields the gateway does not read are ignored, so your services can keep their own fields in user and group records; and a value it cannot read leaves out only the smallest piece that holds it (one extKey, one API rule, one feature), always toward refusal, never toward access. Every problem is logged and listed on the maintenance route
/schemaProblems. Runschemacheckfrom the repository against your databases first. Details: How Go reads imperfect data. Runschemacheckfrom the repository against your databases first. The schema of each collection is in its data-schema folder. - urac
masterDB. The custom registryuracentry must setmasterDB, the core database that holds users and groups. The Go gateway reads users only there. Without it, calls that need the user answer146. - Booleans. Store
trueorfalse. Text such as"true"is read as the Node.js gateway reads it (truthiness) and reported on/schemaProblems. - The
gatewaycustom registry entry. It is checked feature by feature: a feature it cannot read is left out on its own and reported, and the others work.lastSeenneedsinclude, in the method-list form. See Custom registry. - The gateway port. The Go gateway listens on
SOAJS_SERVICE_PORT(4000), not onserviceConfig.ports.controller. Set it if your registry uses another port. See Ports. - Nothing below is in use. Check that no service or client relies on a feature listed under Not ported.
You can run both gateways against the same environment and move traffic one instance at a time.
Not ported
Section titled “Not ported”| Feature | What to use instead |
|---|---|
JWT access tokens (oauth type 0) |
Stored access tokens (oauth type 2), the default. |
Endpoint-type services (src.url, src.urls, a key’s config.<service>.url, API builder) |
Register the service as a SOAJS service, or put it behind one. |
/proxy/redirect |
/soajs/proxy, its current name. |
/proxySocket/* on the maintenance port |
None. |
GET /register |
POST /register. |
?name= on /getRegistry |
?serviceName=. |
| Per-tenant urac databases | masterDB in the urac entry. |
Older data shapes: application-level ACLs, flat apis lists, ACLs without a version, access as a list of groups, dbs.clusters, custom inside the environment record, the old deployer shape, hosts without version, a catalog maintenance.port.type other than maintenance or inherit with a numeric port.value |
The current shapes the console writes. |
SOAJS_SOLO, SOAJS_MONGO_CON_KEEPALIVE |
Not needed: the Go gateway always reads MongoDB and keeps its connections open. |
Configured differently
Section titled “Configured differently”| Node.js | Go | |
|---|---|---|
| Logging | serviceConfig.logger in the registry |
SOAJS_LOG_LEVEL and SOAJS_LOG_FORMAT |
| Gateway port | serviceConfig.ports.controller |
SOAJS_SERVICE_PORT |
| Settings file | none | optional config.yaml |
| Imperfect data | read as found | read as Node.js reads it where defined; otherwise the smallest broken piece is left out, toward refusal, and listed on /schemaProblems |
Behaviour
Section titled “Behaviour”Registry and maintenance port
- The maintenance answers, and MCP’s
serverInfo.version, give the Go gateway’s own version. - Registry dumps never include connection-pool options.
/getRegistrydoes not show the throttling model./registerwrites only the fields the registration gave. A new service withoutrequestTimeoutorrequestTimeoutRenewalgets0.?type=mdaemonon/getRegistryanswers for the daemon.- JSON key order in registry dumps can differ.
Awareness
- With
SOAJS_DEPLOY_HA=kubernetes, a deployer without a namespace gives no host.
Proxy
- Each request timeout renewal counts once.
- When awareness has no gateway host, the awareness block and the
interConnecthosts are left out ofsoajsinjectobj.
urac
- The tenant access resolver call has a total timeout, not only a connection timeout.
- A tie between two main products in
membershipis broken by name. - A requested version absent from the user’s ACL answers
154.
Gateway routes
/soajs/aclsorts the object keys and the API lists infinalACL; the content is the same as the Node.js gateway’s./soajs/proxyanswers139for an invalid%escape inproxyRoute./soajs/mcpreturns Go’s error text for a tool call that fails on the network, and does not use anoperationIdthat is not a string in a tool name.
Idempotency and cache
- With the mongo model, the idempotency lock is taken in one atomic operation, so two requests cannot both take it.
- When the client disconnects before the answer ends, the service’s full answer is still recorded for idempotency and stored in the cache.
- A replayed or cached answer is sent without its hop-by-hop headers.
- When several
:paramcache entries match a path, the first in sorted order wins. An exact entry always wins.
