|
@@ -0,0 +1,25 @@
|
|
|
+<?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.xsd
|
|
|
+ http://code.alibabatech.com/schema/dubbo
|
|
|
+ http://code.alibabatech.com/schema/dubbo/dubbo.xsd
|
|
|
+ ">
|
|
|
+ <!-- 记录监控信息 -->
|
|
|
+ <!-- <dubbo:monitor protocol="registry"/> -->
|
|
|
+ <!-- 提供方应用信息,用于计算依赖关系 -->
|
|
|
+ <dubbo:application name="spring-boot-pay" />
|
|
|
+ <!-- 使用zookeeper注册中心暴露服务地址 subscribe 默认:true 是否向此注册中心订阅服务,如果设为false,将只注册,不订阅 check 默认:true 注册中心不存在时,是否报错 -->
|
|
|
+ <dubbo:registry protocol="zookeeper" address="${dubbo.registry.address}" check="false"/>
|
|
|
+ <!--
|
|
|
+ 生产者配置 生产者 远程默认调用3次 参数 retries="2" async="true" 异步返回结果 默认是同步 timeout="10000" 毫秒
|
|
|
+ 用dubbo协议在20882端口暴露服务 固定线程池 10 启动时建立线程,不关闭,一直持有 负载均衡策略 轮询
|
|
|
+ -->
|
|
|
+ <dubbo:provider timeout="10000" threads="10" threadpool="fixed" loadbalance="roundrobin"/>
|
|
|
+ <!-- name="dubbo" 协议名称 为防止被大量连接撑挂,可在服务提供方限制大接收连接数,以实现服务提供方自我保护。 host 部署外网设置为内网通信地址-->
|
|
|
+ <dubbo:protocol name="dubbo" port="-1" dispatcher="all" accepts="1000" />
|
|
|
+
|
|
|
+ <!-- 使用注解方式-->
|
|
|
+ <dubbo:annotation package="com.itstyle"/>
|
|
|
+</beans>
|