代码改变世界

dubbo源码分析2-reference bean发起服务方法调用

2015-09-23 10:28  chen.simon  阅读(1139)  评论(0编辑  收藏  举报

dubbo源码分析1-reference bean创建

dubbo源码分析2-reference bean发起服务方法调用

dubbo源码分析3-service bean的创建与发布

dubbo源码分析4-基于netty的dubbo协议的server

dubbo源码分析5-dubbo的扩展点机制

dubbo源码分析6-telnet方式的管理实现

duboo源码分析1-reference bean创建 分析了reference bean的创建之后,这里分析怎么拿这个创建出来的bean发起服务调用。

不同的协议对应不同的invoker实现,这个是比较常规的设计。但是针对不同协议所需要的调用过程中的配置信息通过url形式归并统一,这是一个不错的设计。

 

幻灯片2幻灯片3幻灯片4幻灯片5幻灯片6幻灯片7幻灯片8幻灯片9幻灯片10幻灯片11幻灯片12幻灯片13幻灯片14幻灯片15幻灯片16幻灯片17

 

Dubbo reference bean服务方法发起调用

直接连接与使用注册中心在调用细节上url略有差别,使用注册中心的方式多了check=false和anyhost=true:
直连的url
dubbo://localhost:20880/org.simonme.dubbo.demo.provider.service.HelloService?application=consumer-of-helloworld-app
&codec=dubbo
&dubbo=2.4.9
&heartbeat=60000
&interface=org.simonme.dubbo.demo.provider.service.HelloService
&methods=sayHello
&pid=11684
&revision=dubbo_demo_provider
&side=consumer
&timestamp=1442974628602

---------------------------------------------------------------------
用注册中心的url
dubbo://192.168.113.181:20900/org.simonme.dubbo.demo.provider.service.HelloService?anyhost=true
&application=consumer-of-helloworld-app
&check=false
&codec=dubbo
&dubbo=2.4.9
&heartbeat=60000
&interface=org.simonme.dubbo.demo.provider.service.HelloService
&methods=sayHello
&pid=6620
&revision=dubbo_demo_provider
&side=consumer
&timestamp=1442974466825