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

<!-- 定义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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值