1)引入相应jar包

<!-- 引入dubbo服务 start-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<version>2.5.3</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.sgroschupf</groupId>
<artifactId>zkclient</artifactId>
<version>0.1</version>
</dependency>
<!-- 引入dubbo服务 end-->

2)相应配置信息dubbo.xml

<?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:dubbo="http://code.alibabatech.com/schema/dubbo"
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"> <dubbo:application name="demo-system" owner="demo-system"/> <dubbo:registry protocol="zookeeper" address="192.168.10.102:2181"/> <dubbo:protocol name="dubbo" port="-1" heartbeat="2000"/> <!-- 调用服务接口 -->
<dubbo:reference id="dictionaryService" interface="com.iafclub.demo.remote.DictionaryService" check="false" timeout="10000"/> <!--提供服务接口-->
<dubbo:service interface="com.iafclub.demo.remote.DictionaryService" ref="dictionaryServiceImpl"/>
</beans>

3)web.xml配置

    <!-- ContextLoaderListener初始化Spring上下文时需要使用到的contextConfigLocation参数 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<!-- 配置spring.xml和spring-mybatis.xml这两个配置文件的位置,固定写法 -->
<param-value>
classpath:spring.xml,
classpath:spring-mybatis.xml,
classpath:spring-activitymq.xml,
classpath:dubbo.xml,
classpath:spring-redis.xml
</param-value>
</context-param>

4)完成整合

最新文章

  1. volatile不能保证原子性
  2. First,FirstOrDefault,Single,SingleOrDefault的区别
  3. jsp页面传参大汇总-转帖收藏
  4. apache 局域网访问
  5. MFC学习之窗口基础
  6. RxCache 的代码分析,含缓存时间duration的在代码中改变的自己实现的机制
  7. Hibernate HQL和原生SQL查询的一点区别
  8. [实战]记一次PUT方法拿下网站shell
  9. JS中的phototype是JS中比较难理解的一个部分
  10. 黑客白皮书:如何成为一名黑客(附FAQ)
  11. Tomcat剖析(三):连接器(2)
  12. CentOS下编译安装Apache2(新)
  13. Java Swing Graphics Graphics2D的一般用法
  14. exp3.1实现顺序栈的各种操作
  15. 在线修改redo日志大小
  16. Java 200+ 面试题补充 ThreadLocal 模块
  17. 5、Storm集成Kafka
  18. Adb工具的简单使用
  19. activiti官网实例项目activiti-explorer之获取流程节点
  20. 教你一招用 IDE 编程提升效率的骚操作!

热门文章

  1. MySQL提供的几种检索行数据的优化方式
  2. 题目21 包含Min函数的栈
  3. Oracle数据库——查询所有用户
  4. 使用Struts2实现图片上传和拦截器
  5. IntelliJ Idea清除Open Recent里面的项目列表
  6. 十三、Vue中的computed属性
  7. 博客自定义1-皮肤模板 基于SimpleMemory 添加到顶部小按钮
  8. 关于微信小程序使用watch监听数据变化的方法
  9. Spring中Bean的管理问题
  10. js 定时器(setTimeout/setInterval)出现变量未定义(xxx is not defined) 的解决方法