codecamp

Dubbo3 thrift 协议

thrift:// 协议参考手册

当前 dubbo 支持的 thrift 协议是对 thrift 原生协议 1 的扩展,在原生协议的基础上添加了一些额外的头信息,比如 service name,magic number 等。

提示

2.3.0 

以上版本支持

使用 dubbo thrift 协议同样需要使用 thrift 的 idl compiler 编译生成相应的 java 代码,后续版本中会在这方面做一些增强。

依赖

<dependency>
    <groupId>org.apache.thrift</groupId>
    <artifactId>libthrift</artifactId>
    <version>0.8.0</version>
</dependency>

配置

所有服务共用一个端口 2

<dubbo:protocol name="thrift" port="3030" />

使用

可以参考 dubbo 项目中的示例代码

常见问题

  • Thrift 不支持 null 值,即:不能在协议中传递 null 值

  1. Thrift 是 Facebook 捐给 Apache 的一个 RPC 框架 ↩︎

  2. 与原生Thrift不兼容 ↩︎


Dubbo3 redis 协议
Dubbo3 gRPC 协议
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

介绍与示例

应用级服务发现

动态修改运行态配置项

参考手册

配置中心参考手册

元数据参考手册

API 参考手册

Kubernetes 生命周期对齐探针

在线运维命令参考手册

Telnet 命令参考手册

Maven 插件参考手册

性能优化

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }