An Egg.js plugin that provides gRPC client integration with etcd for service discovery. It enables Egg.js applications to dynamically resolve gRPC service endpoints from etcd, load .proto files, and make gRPC calls. Version 1.0.8, released as needed on GitHub. Differentiates by tight integration with Egg.js lifecycle and configuration patterns, supporting multiple gRPC services per app with auto-reconnection. Requires Node >=16.
npm install egg-etcd-grpcNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Activates the Egg.js plugin, configures a gRPC client with etcd service discovery, and makes a gRPC call from a controller.
Ensure the etcd key in config matches the key used by the gRPC server when registering its endpoint.
If possible, switch to a package that uses @grpc/grpc-js, or ensure your environment supports native modules.
Change `loaderOption.longs` to `Number` or use a custom function if you need JavaScript Number (with precision loss) or keep as Long object.
Set deadline to at least 10,000 ms for typical RPCs, or adjust based on your service latency.
Run `npm install egg-etcd-grpc --save` in your project root.
Ensure `config.etcdGrpc.grpc.protoPath` points to a directory containing the .proto files, and the service name in the gRPC call matches exactly (including package).
Verify the service registered in etcd with the same `key` value as in config.etcdGrpc.etcd.key.
Check that `config/plugin.js` has `exports.etcdGrpc = { enable: true, package: 'egg-etcd-grpc' };` and `config/config.default.js` has `exports.etcdGrpc = { ... };` properly set.