学习了一下XML,并结合相应的知识讲解了一下spring的dubbo配置

来源:互联网 发布:互联网共享打印机端口 编辑:程序博客网 时间:2024/05/21 09:39
<!-- 定义xml的版本和编码 --><?xml version="1.0" encoding="UTF-8"?>      定义xml中所有子元素的默认命名空间,只要不给node加前缀就默认加上这个命名空间<beans xmlns="http://www.springframework.org/schema/beans"beans中定义xsi命名空间,需要使用可以在元素前加前缀xsi,  格式是:<prefixName:nodeName></prefixName:nodeName>  例如:<xsi:registry></xsi:registry>。  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  dubbo命名空间  xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"  规定在包含schema的命名空间中,要包括的schema的URI。  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">  <!--  这里说的URI(uniform resource identifier[统一资源标识])有两种格式:  一:URL(Uniform Resource Location[统一资源定位]),这个比较常用  一:URN(Uniform Resource Name[统一资源命名]) -->    <!-- ========================= dubbo RESOURCE DEFINITIONS ========================= -->    <!-- 提供方应用信息,用于计算依赖关系 -->    <dubbo:application name="fpl"  />    <!-- 使用multicast广播注册中心暴露服务地址 -->    <!--  <dubbo:registry address="${zookeeper.address}" />-->    <dubbo:registry protocol="zookeeper" address="${zookeeper.address}" group="${dubbo.group}" />    <!-- 用dubbo协议在20880端口暴露服务 -->    <dubbo:protocol host="${dubbo.host}" name="dubbo" port="${dubbo.port}" payload="41943040" />    <!-- 服务提供者过期时间配置 -->    <dubbo:provider timeout="1000000" retries="0" />    <!-- 声明需要暴露的服务接口 -->    <dubbo:service interface="com.fpl.api.service.sample.SampleServiceApi" ref="sampleService"></dubbo:service></beans>
0 0