Iteratively Migrating an HTTP Service to Go and gRPC Using grpc-gateway and httputil.ReverseProxyService to Go and gRPC Using grpc-gateway and httputil.ReverseProxy Igor Dubinskiy GitHub: idubinskiy Twitter: idubins ● Everything but the browser a. Modify clients to use gRPC b. Use grpc-gateway; see see below ● Browser (using grpc-gateway) a. Modify clients to call new service per route as each required RPC is implemented b. Modify clients to call new service for all routes once all required RPCs service Options to migrate a service from HTTP to gRPC Proxy using grpc-gateway and httputil.ReverseProxy https://github.com/idubinskiy/http-to-grpc-gateway Demo Thank you!0 码力 | 6 页 | 740.76 KB | 1 年前3
基于gRPC go实现消息发布订阅使用gRPC go实现 基于Topic的高效消息订阅发布模型 姓名 张凯 中国电子云 目 录 gRPC go 介绍 01 gRPC四种通信模式及落地场景 02 根据proto生成go桩代码 03 订阅者动态注册 04 发布者消息推送 05 现场案例演示 06 gRPC go介绍 gRPC是什么? 01. 副标题 开篇思考几个问题 01. 副标题 gRPC介绍 gRPC介绍 01. 副标题 gRPC介绍 01. 副标题 gRPC是框架,七层协议 gRPC go是实现,每个语言都有自己的实现 protobuf介绍 01. 副标题 protobuf示例 01. 副标题 gRPC四种通信模式 gRPC四种通信模式 01. 副标题 gRPC四种通信模式 01. 副标题 gRPC的落地场景 基于通信模式如何落地? 01. 副标题 --go-grpc_out=. --go_out=. pubsub.proto protoc: 这是 Protocol Buffers 编译器的执行命令。 --go-grpc_out=.: 这个选项指定了输出 gRPC 相关的 Go 语言代码的目标目录,. 表示当前目录。protoc-gen-go- grpc 插件将会处理 .proto 文件中的服务定义并生成 gRPC 服务器和客户端的接口代码。0 码力 | 31 页 | 2.42 MB | 1 年前3
Bazel build //:GoSTATIC_MEMENVOBJECTS := $(addprefix $(STATIC_OUTDIR)/, $(MEMENV_SOURCES:.cc=.o)) 39 VS google/protobuf grpc/grpc-go ************************************************************ cd $(bazel info execution_root) mple__/grpc/a.proto=git.llsapp.com/common/protos/liulishuo/backend/__example__/ grpc,Mliulishuo/backend/__example__/grpc/b.proto=git.llsapp.com/common/protos/liulishuo/backend/__example__/ grpc,Mliuli mple__/grpc/c.proto=git.llsapp.com/common/protos/liulishuo/backend/__example__/ grpc,Mliulishuo/backend/__example__/grpc/d.proto=git.llsapp.com/common/protos/liulishuo/backend/__example__/ grpc,Mliuli0 码力 | 85 页 | 3.46 MB | 1 年前3
go web 框架 严清年年底组建 Go 团队,重构后端服务体 系,为此造了了⼀一些轮⼦子,如 Gear 框架 基于 kubernetes 和 SOA,部分已上线,如 TCM 消息推送服 务直接提供 HTTP/2 和 gRPC 接⼝口 • 前端架构师 ➞ 后端架构师 ⇢ 技术负责⼈人 技术学习⽆无⽌止境,逼迫个⼈人成⻓长,推进团队成⻓长 Why I Don’t Use Go Web Frameworks authService)) gRPC ⽣生态也玩起了了中间件模式。。。 import "github.com/grpc-ecosystem/go-grpc-middleware" myServer := grpc.NewServer( grpc.StreamInterceptor(grpc_middleware.ChainStreamServer( grpc_ctxtags. StreamServerInterceptor(), grpc_opentracing.StreamServerInterceptor(), grpc_prometheus.StreamServerInterceptor, grpc_zap.StreamServerInterceptor(zapLogger), grpc_auth.StreamServerIn0 码力 | 23 页 | 333.12 KB | 1 年前3
Practices of Go Microservices on Post-Kubernetes-Wei ZhengBackground in Shimo Language • Go • Node • Rust Background in Shimo Framework • Gin • Echo • gRPC • … Background in Shimo Platform • All in Kubernetes • Ingress Controller • Stateless Deployment Documention All comments should use // and not /* */. ... IDL Tool Chain - Style Guide IDL Tool Chain - gRPC Debugging • How to debugging service with dependencies? • Use VPN to connect develop kubernetes Chain - gRPC Local Debugging How do we connect service in k8s cluster before :( IDL Tool Chain - gRPC Local Debugging Now we connect service in k8s cluster like this :) IDL Tool Chain - gRPC Remote0 码力 | 59 页 | 5.66 MB | 1 年前3
Go 构建大型开源分布式数据库技术内幕/ Failover Metadata / Timestamp request Stateless SQL Layer Distributed Storage Layer gRPC gRPC gRPC 数据分片 ● Hash Based Partition ○ Redis ○ 不利于范围 Scan ● Range Based Partition ○ Hbase ○ Range build a Raft layer on top of RocksDB ○ What is Raft? ● Written in Rust! TiKV API (gRPC) Transaction MVCC Raft (gRPC) RocksDB Raw KV API (https://github.com/pingc ap/tidb/blob/master/cmd /benchraw/main Storage stack 2/2 ● Data is organized by Regions ● Region: a set of continuous key-value pairs RPC (gRPC) Transaction MVCC Raft RocksDB ··· Raft ● 复制/分裂/负载均衡 Region 1:[a-e] split Region 1.1:[a-c]0 码力 | 44 页 | 649.68 KB | 1 年前3
02. Service Mesh落地之后_为sidecar注入灵魂 - 周群力Mesh Runtime 分布式能力原语合集 定位 具有明确语义的 API 交互方式 通信协议 网络代理 定位 流量拦截 交互方式 私有协议 通信协议 高 能力丰富度 Http/gRPC 标准协议 19 Dapr Dapr 20 • 提供多种分布式能力 • 对接了丰富的基础组件 • 厂商解绑,跨云部署 21 事情没有那么 简单 Dapr 没解决什么 22 23 Layotto Layotto 架构 24 Layotto MOSN Runtime API Actuator API P a a S gRPC HTTP 业务逻辑 gRPC Client App gRPC Server Config Pub/Sub RPC State Lock ... Config MQ RPC 阿里、蚂蚁 、Dapr 共建 优先复用0 码力 | 63 页 | 880.85 KB | 1 年前3
2.5 Go在猎豹移动的应用地日志+flume+hdfs+hive; 实时监控可以考虑flume sink到kafka,再 依赖Spark计算; RPC 协议&远程调用的选型; net/rpc,thrift,grpc等; 链路追踪,参考Google Dapper论文,核 心思路是关键库植入代码,因为缺乏 AOP编程支持,我们使用golang blog推 荐的依赖context对象; 服务发现、负载均衡依赖ZK; 性能如何? thrift num:111324, time:30s, num/s:3710; grpc num:159999, time:30s, num/s:5333; net/rpc不依赖context,实现数据跟踪, 需要修改源码; grpc支持http2,方便移动端app使用; Cache 模仿cpu使用多级cache; L10 码力 | 24 页 | 4.26 MB | 1 年前3
1.2 基于 Golang 构建高可扩展的云原生 PaaS 平台统⼀配置读取,⽀持默认值、⽀持从⽂件、环境变量、命令⾏参数读取 • 统⼀模块的初始化、启动、关闭 • 统⼀管理模块间的依赖关系 • ⽀持模块间的依赖注⼊ • 包含⼤量现成的微模块 • ⽀持统⼀ gRPC 和 HTTP 接⼝设计、以及拦截器 • 提供快速构建模块的代码⽣成⼯具 Erda Infra 如何设计 Erda Infra 有什么不同 - 不是重复造轮⼦ - 不仅是web框架 - name = 1; } message HelloResponse { string data = 1; } 案例:创建 HTTP/gRPC 接⼝ - 使⽤ protobuf 定义 API - ⾃动⽣成 http 和 gRPC 接⼝ 和client 代码 - 可选⾃动发布 接⼝ 到 OpenAPI 未来的规划 - 轻量化服务注册发现 - ⽀持运⾏时插件,允许⽤户以0 码力 | 40 页 | 8.60 MB | 1 年前3
云原生时代分布式链路追踪实践-曲赛多维度染色采样:指定某用户或指定某文章采样 Trace 传递与采集 Grpc Instrumentation gin Instrumentation ApplicationA Opentelemetry-go SDK Collector Collector Storage backend Storage backend Grpc Instrumentation gin Instrumentation0 码力 | 17 页 | 2.47 MB | 1 年前3
共 20 条
- 1
- 2













