项目介绍
基于spring boot motan 整合demo(支持异步和同步调用),motan配置信息存放在application.yml中,详细配置请参考官网配置清单:https://github.com/weibocom/motan/wiki/zh_configuration
此demo基于zookeeper 注册中心,如果要直接启动,需要安装zookeeper,也可以更改为其他注册中心测试
GitHub下载
码云下载
项目结构
1 2 3 4 5 6 7
| spring-boot-starter-motan ├── fallsea-motan-client ├── fallsea-motan-server ├── fallsea-motan-demo | ├── fallsea-motan-api-demo | ├── fallsea-motan-client-demo | ├── fallsea-motan-server-demo
|
服务端
启动类 MotanServer
配置说明,详细配置请参考官网 配置清单 :https://github.com/weibocom/motan/wiki/zh_configuration
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| fallsea : motan : registry : regProtocol : zookeeper address : 127.0.0.1:2181 requestTimeout : 1000 connectTimeout : 3000 protocol : name : motan minWorkerThread : 20 maxWorkerThread : 50 filter : statistic annotation : package : com.fallsea.demo server : export : 'fallseaMotan:9999' group : fallsea registry : fallseaRegistryConfig
|
客户端
启动类 MotanClientWeb
客户端测试地址:http://localhost:8080/hello/fallsea
配置说明,详细配置请参考 配置清单 :https://github.com/weibocom/motan/wiki/zh_configuration
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| fallsea : motan : registry : regProtocol : zookeeper address : 127.0.0.1:2181 requestTimeout : 1000 connectTimeout : 3000 protocol : name : motan minWorkerThread : 20 maxWorkerThread : 50 filter : statistic annotation : package : com.fallsea.demo client : protocol : fallseaMotan group : fallsea check : false requestTimeout : 3000 connectTimeout : 5000 registry : fallseaRegistryConfig
|