dubbo的多协议

当公司比较大,不同人开发不同的项目,放到不同的服务器上面,然后项目调用dubbo的时候就会有多个dubbo服务

<!--多协议配置-->

<dubbo:protocol name="dubbo" port="20880"/>

<dubbo:protocol name="rmi" port="1099"/>

<!--使用dubbo协议暴露服务-->

<dubbo:service interface="com.xxx.HelloService" ref="helloService" portocol="dubbo"/>

<dubbo:service interface="com.xxx.DemoService" ref="demoService" portocol="rmi"/>

同意服务多协议暴露

<!--多协议配置-->

<dubbo:protocol name="dubbo" port="20880"/>

<dubbo:protocol name="rmi" port="1099"/>

<!--使用多个协议暴露服务-->

<dubbo:reference  interface="com.xxx.DemoService" id="demoService" portocol="dubbo,rmi"/>

多注册中心应用

<!--多个注册中心-->

<dubbo:registry id="base" address="${dubbo.registry.address1}" />

<dubbo:registry id="erp" address="${dubbo.registry.address2}" />

<!--不同注册中心不同应用-->

<dubbo:reference registry="base" interface="com.banksteel.supplier.api.SupplierApi" id="supplierApi" />
 <dubbo:reference registry="erp" interface="com.banksteel.erp.reporting.service.ReportingUnitService"  id="reportingUnitService" />

猜你喜欢

转载自www.cnblogs.com/guilf/p/9263815.html
今日推荐