項(xiàng)目介紹
motan基于spring boot 整合demo耿战,motan配置信息存放在application.yml中禽作,詳細(xì)配置請(qǐng)參考配置清單
此demo基于zookeeper 注冊(cè)中心骏庸,如果要直接啟動(dòng)直焙,需要安裝zookeeper祠斧,也可以使用其他注冊(cè)中心
項(xiàng)目地址 :https://github.com/fallsea/spring-boot-starter-motan
開(kāi)源中國(guó)地址 :https://gitee.com/fallsea/spring-boot-starter-motan
項(xiàng)目結(jié)構(gòu)
spring-boot-starter-motan
├── fallsea-motan-client -- 客戶端通用配置
├── fallsea-motan-server -- 服務(wù)端通用配置
├── fallsea-motan-demo -- demo 示例
| ├── fallsea-motan-api-demo -- api 示例
| ├── fallsea-motan-client-demo -- 客戶端調(diào)用示例
| ├── fallsea-motan-server-demo -- 服務(wù)端示例
服務(wù)端
啟動(dòng)類 MotanServer
配置說(shuō)明盹兢,詳細(xì)配置請(qǐng)參考配置清單
fallsea :
motan :
#注冊(cè)中心配置
registry :
regProtocol : zookeeper #注冊(cè)中心協(xié)議
address : 127.0.0.1:2181 #注冊(cè)中心地址
requestTimeout : 1000 #注冊(cè)中心連接超時(shí)時(shí)間(毫秒)
connectTimeout : 3000 #注冊(cè)中心請(qǐng)求超時(shí)時(shí)間(毫秒)
#協(xié)議配置
protocol :
name : motan #協(xié)議名稱
minWorkerThread : 20 #最小工作pool線程數(shù)
maxWorkerThread : 50 #最大工作pool線程數(shù)
filter : statistic
#指定需要解析的包名
annotation :
package : com.fallsea.demo
#服務(wù)端配置
server :
export : 'fallseaMotan:9999' #服務(wù)端口
group : fallsea
registry : fallseaRegistryConfig
客戶端
啟動(dòng)類 MotanClientWeb
客戶端測(cè)試地址:http://localhost:8080/hello/fallsea
配置說(shuō)明邻梆,詳細(xì)配置請(qǐng)參考配置清單
fallsea :
motan :
#注冊(cè)中心配置
registry :
regProtocol : zookeeper #注冊(cè)中心協(xié)議
address : 127.0.0.1:2181 #注冊(cè)中心地址
requestTimeout : 1000 #注冊(cè)中心連接超時(shí)時(shí)間(毫秒)
connectTimeout : 3000 #注冊(cè)中心請(qǐng)求超時(shí)時(shí)間(毫秒)
#協(xié)議配置
protocol :
name : motan #協(xié)議名稱
minWorkerThread : 20 #最小工作pool線程數(shù)
maxWorkerThread : 50 #最大工作pool線程數(shù)
filter : statistic
#指定需要解析的包名
annotation :
package : com.fallsea.demo
#客戶端配置
client :
protocol : fallseaMotan
group : fallsea
check : false
requestTimeout : 3000 #請(qǐng)求超時(shí)時(shí)間(毫秒)
connectTimeout : 5000 #連接超時(shí)時(shí)間(毫秒)
registry : fallseaRegistryConfig