You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
2.9 KiB
47 lines
2.9 KiB
<?xml version="1.0" encoding="UTF-8"?>
|
|
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context"
|
|
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.xsd
|
|
http://code.alibabatech.com/schema/dubbo
|
|
http://code.alibabatech.com/schema/dubbo/dubbo.xsd
|
|
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
|
|
<!-- 提供方应用信息,用于计算依赖关系 -->
|
|
<dubbo:application name="eleand-app-consumer" />
|
|
|
|
<!-- 使用multicast广播注册中心暴露服务地址 -->
|
|
<!-- <dubbo:registry address="multicast://224.5.6.7:1234" /> -->
|
|
|
|
<!-- 使用zookeeper注册中心暴露服务地址,这里可以注册多个zk中心-->
|
|
<dubbo:registry id="fz" address="zookeeper://127.0.0.1:2181" />
|
|
<dubbo:registry id="ly" address="zookeeper://127.0.0.1:2182" />
|
|
<!-- <dubbo:registry id="jssy" address="zookeeper://127.0.0.1:2181" />-->
|
|
|
|
<!-- 用dubbo协议在8090端口暴露服务 -->
|
|
<dubbo:protocol name="dubbo" port="8090" />
|
|
|
|
<!-- 和本地bean一样实现服务 -->
|
|
|
|
<!-- 用于获取spring上下文索引 -->
|
|
<bean id="fastDistributedServiceConsumer" class="com.openintersrv.distributed.FastDistributedServiceConsumer"> </bean>
|
|
|
|
<!-- 每一个zookeepter提供的dao处理接口服务 -->
|
|
<bean id="distributedaoaction" class="com.wat.distributed.service.impl.FastDistributedDaoActionImpl"> </bean>
|
|
<bean id="distributefunctionaction" class="com.openintersrv.distributed.FastDistributedFunctionActionImpl"> </bean>
|
|
|
|
<!-- 声明需要暴露的服务接口 -->
|
|
<!-- 根据registry指定的不同zookeeper注册中心的dao处理接口服务器 -->
|
|
<dubbo:service interface="com.wat.distributed.service.IFastDistributedDaoAction" ref="distributedaoaction" retries="0" timeout="50000"/>
|
|
|
|
<!-- 服务提供注册 -->
|
|
<dubbo:service registry="fz" interface="com.wat.distributed.service.IFastDistributedFunctionAction" ref="distributefunctionaction" retries="0" timeout="50000"/>
|
|
<dubbo:service registry="ly" interface="com.wat.distributed.service.IFastDistributedFunctionAction" ref="distributefunctionaction" retries="0" timeout="50000"/>
|
|
|
|
<dubbo:reference registry="fz" id="fastdistributedaoaction" interface="com.wat.distributed.service.IFastDistributedDaoAction" />
|
|
|
|
|
|
<!-- 服务消费注册 -->
|
|
<dubbo:reference registry="fz" id="fzfastdistributefunctionaction" interface="com.wat.distributed.service.IFastDistributedFunctionAction" />
|
|
<dubbo:reference registry="ly" id="lyfastdistributefunctionaction" interface="com.wat.distributed.service.IFastDistributedFunctionAction" />
|
|
|
|
</beans>
|
|
|