学习了一下XML,并结合相应的知识讲解了一下spring的dubbo配置
2016-08-24 15:36
716 查看
<!-- 定义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>
相关文章推荐
- Spring AOP基础知识学习——XML配置
- spring 学习--beans.xml配置文件的讲解
- 学习Spring必学的Java基础知识(4)----XML基础知识
- spring MVC学习笔记(二) springMVC.xml配置文件解析
- Spring核心学习(4)从XML中读取BeanDefinition-将代码变成配置
- Spring学习篇02-Bean的xml配置
- java 框架基础知识(4)----XML基础知识-->Spring配置
- Spring学习笔记 使用XML配置实现Bean的auto-wiring (自动绑定)
- Spring4 学习笔记(3)-Spring 基于 XML 的方式配置 Bean
- spring学习笔记(24)——xml方式配置事务
- 说一下Spring的applicationContext.xml的配置文件
- 一个spring 基本知识的微博(怎么加载多个xml、多个property文件、aop配置、监视器)
- 工作流Activiti的学习总结(四)Spring和Activiti的整合配置讲解
- 工作流Activiti的学习总结(一)Spring和Activiti的整合配置讲解
- Spring Security 从配置入门 学习讲解。万恶之源------------web.xml
- Spring视频学习(十)使用XML配置事务
- Java 学习笔记04:Spring XML配置文件Bean
- 【spring MVC学习一】web.xml中的spring的配置
- spring结合时,web.xml的配置
- Spring Security 从配置入门 学习讲解。刽子手------------securityConfig.xml