dubbo 有两个重要的配置文件
dubbo-provider.xml文件
dubbo-xxx-consumer.xml文件
dubbo-provider.xml 文件结果如下:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<!-- 提供者服务 -->
<dubbo:service interface="com.companyName.sysName.facade.packageName.XXXFacade" ref="XXXFacade" provider="default-provider"
mock="false" version ="4.0.0"/>
</beans>
dubbo-xxx-consumer.xml 文件结构如下:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<!-- xxx服务注册中心地址 -->
<dubbo:registry id="xxxRegistryCenter"
protocol="${xxx.web.dubbo.registry.protocol}"
address="${internal.msg.registry.address}"
transporter="${xxx.web.dubbo.registry.transporter}"
timeout="${xxx.web.dubbo.consumer.timeout}"/>
<dubbo:reference interface="com.companyName.sysName.facade.xxxFacade" id="xxxFacade" registry="xxxRegistryCenter" version="4.0.0" check="false" />
</beans>