kitex学习笔记(2)kitex基本特性

1、kitex的支持的编解码协议

(1)目前,Kitex 支持了 thrift 和 protobuf 两种编解码协议。

(2)thrift编解码

生成代码时可以不指定 thrift 协议,默认就是 thrift。

//生成客户端代码
kitex -type thrift ${service_name} ${idl_name}.thrift

//生成服务端代码
kitex -type thrift -service ${service_name} ${idl_name}.thrift  

(3)protobuf 编解码协议

生成代码时必须指定 protobuf 协议。

//生成客户端代码
kitex -type protobuf -I idl/ idl/${proto_name}.proto

//生成服务端代码
kitex -type protobuf -service ${service_name} -I idl/ idl/${proto_name}.proto

  

2、kitex消息类型

  

 

 

 

 

参考:Kitex 编解码协议_w3cschool

posted @ 2022-10-26 15:07  ☞@_@  阅读(84)  评论(0编辑  收藏  举报