demo_motan_server.xml 2.3 KB
Newer Older
S
shenhongxi 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~  Copyright 2009-2016 Weibo, Inc.
  ~
  ~    Licensed under the Apache License, Version 2.0 (the "License");
  ~    you may not use this file except in compliance with the License.
  ~    You may obtain a copy of the License at
  ~
  ~        http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~    Unless required by applicable law or agreed to in writing, software
  ~    distributed under the License is distributed on an "AS IS" BASIS,
  ~    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~    See the License for the specific language governing permissions and
  ~    limitations under the License.
  -->

<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"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://api.weibo.com/schema/motan http://api.weibo.com/schema/motan.xsd">

    <!-- 业务具体实现类 -->
武汉红喜's avatar
武汉红喜 已提交
25
    <bean id="demoMotanService" class="com.itlong.motan.demo.DemoMotanServiceImpl"/>
S
shenhongxi 已提交
26 27 28 29 30 31 32

    <!-- 协议配置。为防止多个业务配置冲突,推荐使用id表示具体协议。-->
    <motan:protocol id="demoMotan" default="true" name="motan"
                    maxServerConnection="80000" maxContentLength="1048576"
                    maxWorkerThread="800" minWorkerThread="20"/>

    <!-- 通用配置,多个rpc服务使用相同的基础配置. group和module定义具体的服务池。export格式为“protocol id:提供服务的端口”-->
武汉红喜's avatar
武汉红喜 已提交
33
    <motan:basicService export="demoMotan:8003"
S
shenhongxi 已提交
34 35 36 37
                        group="motan-demo-rpc" accessLog="false" shareChannel="true" module="motan-demo-rpc"
                        application="myMotanDemo" registry="registry" id="serviceBasicConfig"/>

    <!-- 具体rpc服务配置,声明实现的接口类。-->
武汉红喜's avatar
武汉红喜 已提交
38 39
    <motan:service interface="com.itlong.motan.demo.DemoMotanService"
                   ref="demoMotanService" export="demoMotan:8003" basicService="serviceBasicConfig">
S
shenhongxi 已提交
40
    </motan:service>
武汉红喜's avatar
武汉红喜 已提交
41 42
    <motan:service interface="com.itlong.motan.demo.DemoMotanService"
                   ref="demoMotanService" export="demoMotan:8004" basicService="serviceBasicConfig">
S
shenhongxi 已提交
43 44 45
    </motan:service>

</beans>