spring.motan.xml Maven / Gradle / Ivy
<?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:motan="http://api.weibo.com/schema/motan" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://api.weibo.com/schema/motan http://api.weibo.com/schema/motan.xsd"> <!-- 注册中心的配置 --> <motan:registry regProtocol="${rpc.registry}" name="rpc_registry" address="${rpc.address}" connectTimeout="${rpc.connect.timeout}" /> <!-- 协议配置。为防止多个业务配置冲突,推荐使用id表示具体协议。 --> <motan:protocol id="motan" name="motan" default="true" requestTimeout="${rpc.request.timeout}" maxContentLength="${rpc.protocol.maxContentLength}" maxWorkerThread="${rpc.protocol.maxThread}" minWorkerThread="${rpc.protocol.minThread}" maxClientConnection="${rpc.protocol.maxClientConnection}" /> <!-- 服务的默认配置 --> <motan:basicService id="motanServiceBasicConfig" filter="dataSourceAspect,default" shareChannel="true" registry="rpc_registry" export="motan:${rpc.protocol.port}" /> <!-- 注解服务端要暴露的服务接口 --> <motan:annotation package="${rpc.package}" /> <!-- 通用referer基础配置 --> <motan:basicReferer id="motanClientBasicConfig" registry="rpc_registry" protocol="motan" throwException="false" retries="${rpc.consumer.retries}" check="true" /> </beans>