The 2-dubbo usage of the first Knowledge Dubbo series

Source: Internet
Author: User

Usage

(#)

Local Service: (Spring configuration) Local.xml
<beanid=“xxxService” class=“com.xxx.XxxServiceImpl” /><beanid=“xxxAction” class=“com.xxx.XxxAction”>    <propertyname=“xxxService” ref=“xxxService” /></bean>
Remote service: (Spring configuration)

On the basis of local services, you can complete the remoting by simply configuring:

    • Split the above local.xml configuration into two parts, place the service definition part on the service provider Remote-provider.xml, and place the service reference part in the service consumer Remote-consumer.xml.
    • and increase the exposure service configuration <dubbo:service> in the provider, add the Referral service configuration <dubbo:reference> in the consumer.

As follows:

Remote-provider.xml
<beanid=“xxxService” class=“com.xxx.XxxServiceImpl” /> <!-- 和本地服务一样实现远程服务 --><dubbo:serviceinterface=“com.xxx.XxxService” ref=“xxxService” /> <!-- 增加暴露远程服务配置 -->
Remote-consumer.xml
<dubbo:referenceid=“xxxService” interface=“com.xxx.XxxService” /> <!-- 增加引用远程服务配置 --><beanid=“xxxAction” class=“com.xxx.XxxAction”> <!-- 和本地服务一样使用远程服务 -->    <propertyname=“xxxService” ref=“xxxService” />

The 2-dubbo usage of the first Knowledge Dubbo series

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.