Skip to end of metadata
Go to start of metadata

Bad Smell

(+) (#)

这里记录的是Dubbo设计或实现不优雅的地方。

URL Convert

1. 点对点暴露和引用服务

1.1. 直接暴露服务:
EXPORT(dubbo://provider-address/com.xxx.XxxService?version=1.0.0")

1.2. 点对点直连服务:
REFER(dubbo://provider-address/com.xxx.XxxService?version=1.0.0)

2. 通过注册中心暴露服务

2.1. 向注册中心暴露服务:
EXPORT(registry://registry-address/com.alibaba.dubbo.registry.RegistrySerevice?registry=dubbo&export=ENCODE(dubbo://provider-address/com.xxx.XxxService?version=1.0.0))

2.2. 获取注册中心:url.setProtocol(url.getParameter("registry", "dubbo"))
GETREGISTRY(dubbo://registry-address/com.alibaba.dubbo.registry.RegistrySerevice)

2.3. 注册服务地址:url.getParameterAndDecoded("export"))
REGISTER(dubbo://provider-address/com.xxx.XxxService?version=1.0.0)

3. 通过注册中心引用服务

3.1. 从注册中心订阅服务:
REFER(registry://registry-address/com.alibaba.dubbo.registry.RegistrySerevice?registry=dubbo&refer=ENCODE(version=1.0.0))

3.2. 获取注册中心:url.setProtocol(url.getParameter("registry", "dubbo"))
GETREGISTRY(dubbo://registry-address/com.alibaba.dubbo.registry.RegistrySerevice)

3.3. 订阅服务地址:url.addParameters(url.getParameterAndDecoded("refer"))
SUBSCRIBE(dubbo://registry-address/com.xxx.XxxService?version=1.0.0)

3.4. 通知服务地址:url.addParameters(url.getParameterAndDecoded("refer"))
NOTIFY(dubbo://provider-address/com.xxx.XxxService?version=1.0.0)

4. 注册中心推送路由规则

4.1. 注册中心路由规则推送:
NOTIFY(route://registry-address/com.xxx.XxxService?router=script&type=js&rule=ENCODE(function{...}))

4.2. 获取路由器:url.setProtocol(url.getParameter("router", "script"))
GETROUTE(script://registry-address/com.xxx.XxxService?type=js&rule=ENCODE(function{...}))

5. 从文件加载路由规则

5.1. 从文件加载路由规则:
GETROUTE(file://path/file.js?router=script)

5.2. 获取路由器:url.setProtocol(url.getParameter("router", "script")).addParameter("type", SUFFIX(file)).addParameter("rule", READ(file))
GETROUTE(script://path/file.js?type=js&rule=ENCODE(function{...}))

Invocation Parameters

  • path 服务路径
  • group 服务分组
  • version 服务版本
  • dubbo 使用的dubbo版本
  • token 验证令牌
  • timeout 调用超时
Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.