dubbo 直连

第一种:

<dubbo:reference interface="com.xxx.XxxService" id="xxxService" url="dubbo://192.168.1.12:12006/xxxOrder"/>
这种适合开发联调是方式

测试的时候不能硬编码的,可以采用如下的配置文件

在VM options 中加入下面配置文件
-Ddubbo.properties.file=/C:UsersadminDesktopdubbo.properties

dubbo.properties 内容如下 此文件的xxxService 对应 上面id

dubbo.reference.xxxService.url=dubbo://192.168.1.12:12006/xxxOrder




原文地址:https://www.cnblogs.com/xlh91118/p/7337681.html