nest-cloud / nestcloud-grpc-example Goto Github PK
View Code? Open in Web Editor NEWHow to use nestcloud/grpc for loadbalance rpc call.
How to use nestcloud/grpc for loadbalance rpc call.
我看最新的仓库中没有 @nestcloud/core
这个模块。这个grpc的demo是不是应该更新一下
直接用ts-protoc-gen 生成的文件 和例子中的完全不一样。。。
I get this error when testing out this demo, I think it might be an issue with nestcloud-grpc
Nest] 24268 - 10/26/2020, 10:18:40 AM [ExceptionsHandler] Cannot read property 'id' of null +3493ms
TypeError: Cannot read property 'id' of null
at GrpcClient.getProxyService (/home/koolamusic/git/nestcloud-grpc-example/node_modules/@nestcloud/grpc/grpc-client.js:34:35)
at Object.grpcService.<computed> [as list] (/home/koolamusic/git/nestcloud-grpc-example/node_modules/@nestcloud/grpc/grpc-client.js:20:46)
at HeroController.<anonymous> (/home/koolamusic/git/nestcloud-grpc-example/client/hero.controller.ts:32:45)
at Generator.next (<anonymous>)
at /home/koolamusic/git/nestcloud-grpc-example/client/hero.controller.ts:19:71
at new Promise (<anonymous>)
at __awaiter (/home/koolamusic/git/nestcloud-grpc-example/client/hero.controller.ts:15:12)
at HeroController.list (/home/koolamusic/git/nestcloud-grpc-example/client/hero.controller.ts:35:16)
at /home/koolamusic/git/nestcloud-grpc-example/node_modules/@nestjs/core/router/router-execution-context.js:38:29
at InterceptorsConsumer.intercept (/home/koolamusic/git/nestcloud-grpc-example/node_modules/@nestjs/core/interceptors/interceptors-consumer.j
s:11:20)
when i import
ConsulServiceModule.register({dependencies: [NEST_BOOT],}),
LoadbalanceModule.register({ dependencies: [NEST_BOOT], }),
inside the app module
TypeError: metatype is not a constructor
at Injector.instantiateClass (/home/user/bigtix-nest-cart/node_modules/@nestjs/core/injector/injector.js:284:19)
at callback (/home/user/bigtix-nest-cart/node_modules/@nestjs/core/injector/injector.js:75:41)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
When I run yarn start:server1
or yarn start:server2
,both I got following error message:
[Nest] 4552 - 2020-12-18 16:57:12 [ConsulService] Unable to initial ServiceModule, retrying... +6015ms
Error: connect ECONNREFUSED 127.0.0.1:8500
Did I miss something?
I'm not familiar with Consul or gRpc
I just start up the 2 server with scripts in package.json directly
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.