Dubbo:服务暴露方式

Dubbo服务暴露方式

1.通过注解暴露       第一行写入服务的package,第二行不需要     使用Dubbo的@Service注解在实现类的上面
<!-- 使用注解方式暴露接口  -->  
<dubbo:annotation package="com.dotoyo.dsframe.form" />    
<!-- 加入spring注解扫描 
<context:component-scan base-package="com.frame.test"/> -->

2.非注解暴露

<!-- 接口的位置 --> 
<dubbo:service interface="com.dotoyo.dsframe.form.interf.ITfPreform" ref="demoService" executes="10" /> 
<!-- 实现bean,客户端应用的bean就以这个id名称为主 --> 
<bean id="demoService" class="com.dotoyo.dsframe.form.service.TfPreformServiceImpl" />

原文参考:https://www.cnblogs.com/Bruce3555/p/7278049.html

猜你喜欢

转载自blog.csdn.net/weixin_38750084/article/details/83934469
今日推荐