dubbo服务发布消费过程
2019-11-21 13:32:03 8 举报
dubbo服务发布&消费过程
作者其他创作
大纲/内容
export()
AbstractProxyFactory
register()
openService()
new NettyClient()
ZookeeperRegistryFactory
RegistryDirectory
request()
get()
registry
channel.write()
服务端发布服务过程
FailoverCluster
invokers
ProxyFactory$Adaptive
notify()
registry.subscribe()
invoker(AbstractProxyInvoker)
methodInvokerMap = invokers
NettyClient
doSubscribe()
Protocol$Adaptive
createRegistry()
join()
NettyTransporter
AbstractDirectory
ServiceConfig
doExportUrlsFor1Protocol()
StubProxyFactoryWrapper
refreshInvoker()
getRegistry()
ReferenceConfig
select()
subscribe()
AbstractRegistry
消费端执行方法
createService()
Proxy0 = Proxy.getProxy(interfaces).newInstance(new InvokerInvocationHandler(invoker))
DubboInvoker
invoke()
MockClusterWrapper
refer()
RandomLoadBalance
RegistryProtocol
invoker = ProtocolFilterWrapper$1(ListenerInvokerWrapper(DubboInvoker()))
getInvoker()
AbstractRegistryFactory
doInvoke()
Filter/Listener
后面为netty传输,暂不分析
InvokerInvocationHandler
HeaderExchangeChannel
FailbackRegistry
Transporter$Adaptive
new HeaderExchangeServer()
doLocalExport
doSelect()
AbstractClusterInvoker
ReferenceCountExchangeClient
refer()
DubboProtocol
serverMap.put(service)
HeaderExchanger
afterPropertiesSet()
HeaderExchangeClient
依据负载均衡算法获取一个可执行的invoker
getObject()
Exchanger$Adaptive
recreate()
bind()
invoker = MockClusterInvoker(FailoverClusterInvoker)
list()
ZookeeperRegistry
RegistryFactory$Adaptive
doRegistry()
FailoverClusterInvoker
doList()
消费端生成代理对象过程
send()
zkClient.create()
RpcResult
Exchangers
init()
doNotify()
AbstractInvoker
createProxy()
toInvokers()
doExportUrls()
watcher机制循环执行
AbstractPeel
result
doRefer()
LoadBalance负载均衡
zkClient = zookeeperTransporter.connect()
JavassistProxyFactory
Cluster$Adaptive
MockClusterInvoker
ReferenceBean
doExport
ServiceBean
invoke
getProxy()
invoker
收藏
收藏
0 条评论
下一页