我正在运行我的NodeJs应用程序,我收到一个错误.
sudo /usr/local/bin/node app.js
Error: Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v57-linux-x64-glibc
Found: [node-v59-linux-x64-glibc]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module '/home/projects/kj_app/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc
/grpc_node.node'
at Object.<anonymous> (/home/projects/kj_app/node_modules/grpc/src/grpc_extension.js:53:17)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/projects/kj_app/node_modules/grpc/src/client.js:37:12)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at …Run Code Online (Sandbox Code Playgroud) 大家晚上好,我才接触 Java 和 Android Studio 几个月,有人能帮我解决这个错误吗?每次模拟器启动时都会发生。谢谢
模拟器:在 127.0.0.1:8554 启动 GRPC 服务器
模拟器:模拟器:警告:EmulatorService.cpp:448:找不到证书文件:C:\Users\Sawye.android\emulator-grpc.cer 安全将被禁用。
我想测试用Go编写的gRPC服务.我正在使用的示例是来自grpc-go repo的Hello World服务器示例.
protobuf的定义如下:
syntax = "proto3";
package helloworld;
// The greeting service definition.
service Greeter {
// Sends a greeting
rpc SayHello (HelloRequest) returns (HelloReply) {}
}
// The request message containing the user's name.
message HelloRequest {
string name = 1;
}
// The response message containing the greetings
message HelloReply {
string message = 1;
}
Run Code Online (Sandbox Code Playgroud)
greeter_server主要类型是:
// server is used to implement helloworld.GreeterServer.
type server struct{}
// SayHello implements helloworld.GreeterServer
func (s *server) …Run Code Online (Sandbox Code Playgroud) 我看到越来越多的软件组织在面向服务的体系结构中使用gRPC,但人们仍然在使用REST.在什么用例中使用gRPC是有意义的,何时使用REST进行服务间通信是有意义的?
有趣的是,我遇到过使用REST和gRPC的开源项目.例如,Kubernetes和Docker Swarm都在某种程度上使用gRPC进行集群协调,但也公开REST API以与主/领导节点连接.为什么不上下使用gRPC?
嘿,我正在尝试使用 Go 和 Grpc 制作一个小型测试客户端,
opts := grpc.WithInsecure()
cc, err := grpc.Dial("localhost:9950", opts)
if err != nil {
log.Fatal(err)
}
Run Code Online (Sandbox Code Playgroud)
函数WithInsecure()调用给出警告:
grpc.WithInsecure 已弃用:使用 insecure.NewCredentials() 代替。
我不确定如何使用这个新函数调用,某处有示例吗?谢谢
go version: 去版本 go1.14 linux/amd64
去.mod
module [redacted]
go 1.14
require (
github.com/golang/protobuf v1.4.0-rc.2
google.golang.org/grpc v1.27.1
google.golang.org/protobuf v1.20.0 // indirect
)
Run Code Online (Sandbox Code Playgroud)
我正在运行以下命令:
protoc -I ./src/pbdefs/protos/ --go-grpc_out=. src/pbdefs/protos/*.proto
Run Code Online (Sandbox Code Playgroud)
从.proto文件生成我的 GRPC 输出文件,但出现错误
protoc-gen-go-grpc: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--go-grpc_out: protoc-gen-go-grpc: Plugin failed with status code 1.
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 go grpc 构建示例应用程序,但无法使用“protoc”生成代码
已使用以下方法安装了所需的库/go 包:
也尝试过设置路径,但没有运气。
示例“原型”文件:
syntax = "proto3";
package greet;
option go_package="greetpb";
service GreetService{}
Run Code Online (Sandbox Code Playgroud)
错误消息:“protoc-gen-go:程序未找到或不可执行 --go_out:protoc-gen-go:插件失败,状态代码为 1。”
我想开发一个微服务结构的项目。我必须使用 php/laravel 和 nodejs/nestjs 我的微服务之间的最佳连接方法是什么。我读到了 RabbitMQ 和 NATS 消息传递以及 GRPC 哪个选项更适合微服务?为什么?提前致谢
尝试编译我的原型 - 我需要编译它们以在我的反应应用程序中使用。但我收到这个错误。我运行命令如下:
cd src/main/proto && protoc -I=. *.proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs,mode=grpcwebtext:.
Run Code Online (Sandbox Code Playgroud)
在哪里可以找到 protoc-gen-js?我没有遇到任何回购。
我试图找出为什么我的grpc调用不起作用,但我无法弄清楚如何打开调试,所以我可以看到通过grpc连接发送和接收的数据.
你如何打开grpc调用的调试?