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消息类型

浙公网安备 33010602011771号