dangdangdotcom / dubbox

Dubbox now means Dubbo eXtensions, and it adds features like RESTful remoting, Kyro/FST serialization, etc to the Dubbo service framework.
http://dangdangdotcom.github.io/dubbox
Apache License 2.0
4.89k stars 2.06k forks source link

如何将reference 与service串起来? #310

Open scofier opened 7 years ago

scofier commented 7 years ago

通过reference可以获取远程服务的引用, 业务中可以像操作本地bean一样调用接口方法。

如果将reference于service串起来, 这样就可以将远程的dubbo服务转换为rest:

<dubbo:reference check="false" interface="org.xxx.OrderRpc" id="testOrderRpc" />

将上面的reference当做一个bean,并通过service暴露出去

<dubbo:service interface="org.xxx.OrderRpc" ref="testOrderRpc" protoco="rest" />

这样配置后, 访问rest接口会报错:

com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote proxy method xxxx to

请问有人有做过类似的试验么?