前面学习了netty和rocketmq,当然前面的文章还会继续更新,继续往下写
2016 没几天了,我打算写下dubbo
2017 继续深入源码,大家有啥问题 都可以一起来讨论
源码搭建
下载源码
同样从git下载代码,https://github.com/alibaba/dubbo.git 本文使用的是tag 2.5.3的
下载完了,mvn cleaninstall -Dmaven.test.skip
这时候会报错
Non-resolvable parent POM: Could not transfer artifact com.alibaba:opensesame:pom:2.0 from/to opensesame.releases
下载opensesame
那么就下载opensesame https://github.com/alibaba/opensesame.git
下载了编译下,mvn cleaninstall -Dmaven.test.skip
接着它会报
Could not transfer artifact com.alibaba:hessian-lite:pom:3.2.1-fixed-2
from/to opensesame.releases (http://code.alibabatech.com/mvn/releases):
Connection to http://code.alibabatech.com refused: Conne
下载hessian-lite
那我们就下载hessian-lite https://github.com/ROCK-SOLID-CN/hessian-lite.git
编译完了之后,需要手动把target这个jar包 负责到你本地的maven仓库里面
修改fastjson版本
会报错找不到fastjson 1.1.X版本 然后你修改成1.1.39
build success
安装zookeeper
运行dubbo肯定要用到注册中心,我们就用zookeeper来做我们的注册中心
一个是学习文档,一个是下载页面,相信你可以搞定的
run helloworld
接下来用下源码里面带的例子,dubbo-demo-provider和dubbo-demo-consumer
run provider
修改dubbo.properties
run demo provider
服务起来了,也注册到zk上了
run consumer
同样修改 dubbo-demo-consumer这个项目的dubbo.properties
run DemoConsumer