dubbo/dubbox(二)Thrift协议实现

dubbo采用Thrift协议其实官网上已经说的很明白了。具体配置文件我在官网上没有发现。特此写下该文章,备忘。

1.写Thrift 的IDL,生成JAVA文件。copy到服务端和客户端,客户端只拷贝接口文件就OK。

2.服务端对接口实现。

3.书写配置文件,我在网上搜索了好久都没有找到配置文件。

   其中自己配置Iface接口的时候,总是报错,找不到该类。原因是接口在类的内部要使用,com.sfbest.thrift.demo.HelloWorldService$Iface而并非com.sfbest.thrift.demo.HelloWorldService.Iface。

	<dubbo:application name="dubboTest-client" />
	<dubbo:registry address="zookeeper://hadoop3:2181"></dubbo:registry>
	<dubbo:protocol name="thrift" port="3030" />
	<dubbo:reference id="userService" interface="com.service.UserService" check="false" async="false" protocol="thrift"></dubbo:reference>
	<dubbo:reference id="helloWordService" interface="<span style="color:#ff6666;"><strong>com.sfbest.thrift.demo.HelloWorldService$Iface</strong></span>" check="false" async="false"></dubbo:reference>
4.剩下的和其他的配置没有区别,具体的代码官网有详细的,再此不啰嗦了。


  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值