springboot引用dubbo的方式

1.以此种接口依赖的方式

这种相当于将其他模块的服务先拿过来dubbo自己在本模块中进行注入,此时可以直接用Spring的@Autowired注解引用 ,这种情况下本模块的扫描dubbo是所引用的模块

<dubbo:reference interface="com.xian62.system.api.service.ITripUserService" id="tripUserService" />
<dubbo:reference interface="com.xian62.system.api.service.ICaptchaService" id="captchaService" />
<dubbo:reference interface="com.xian62.system.api.service.ICurrencyRateService" id="currencyRateService" />

  1. 以扫描包的形式

    <dubbo:annotation package="com.xian62.web.api"/>

    此种方式是相当于将其他模块的服务拿过来,此时想要引入某个模块的话 需要使用dubbo的@Reference注解,这种情况下扫描的是本模块的包

原文地址:https://www.cnblogs.com/esileme/p/9537578.html