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" />

猜你喜欢

转载自blog.csdn.net/qq_35873847/article/details/80427555
今日推荐