Fetch the repository succeeded.
该服务是基于 Grpc 反射 开发的一款 Grpc 换为 Http 请求的工具。
因为是基于反射开发,所以使用时无需修改 proto 及相关的代码实现,只需在启动服务时开启反射功能。
因为是基于反射开发,需要服务端开启反射功能,开启方式:
grpc-spring-boot-starter
grpc.server.reflection-service-enabled=true
Server server = ServerBuilder.forPort(SERVER_PORT)
.addService(new HelloServiceImpl())
// 这里开启反射
.addService(ProtoReflectionService.newInstance())
.build()
.start();
grpc.endpoint.服务名称=dev.coding.oa.com:9902
示例 proto
syntax = "proto3";
package com.qianxunclub.proto;
option java_outer_classname = "HelloProto";
message HelloRequest {
string fieldName = 1;
}
message HelloResponse {
}
service HelloService {
rpc HelloWorld (HelloRequest) returns (HelloResponse);
}
GET
请求 http://localhost:8080/api/服务名称/
curl \
--location \
--request POST 'http://localhost:8080/api/服务名称/Grpc方法名称[com.qianxunclub.proto.HelloService.HelloWorld]' \
--header 'Content-Type: application/json' \
--data-raw '{
"fieldName":"value"
}'
# 这个配置是所部署的服务器地址的 IP 或者 域名,为了 swagger 执行调用
swagger.serverUrl=http://localhost:8080
访问:http://localhost:8080/swagger-ui/index.html
OPENAPI 地址填写:http://localhost:8080/api/v3/api-docs/服务名称
./docker-build.sh
构建完镜像名称为:grpc2http-gateway:latest
cd docker-compose
docker-compose up -d
欢迎提交 PR 升级,有什么好建议或者想法的,可以添加QQ群一起讨论:852214454
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
Activity
Community
Health
Trend
Influence
:Code submit frequency
:React/respond to issue & PR etc.
:Well-balanced team members and collaboration
:Recent popularity of project
:Star counts, download counts etc.