forked from LianjiaTech/retrofit-spring-boot-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f50cfbb
commit a7c7a94
Showing
4 changed files
with
85 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
.../java/com/github/lianjiatech/retrofit/spring/boot/interceptor/BaseLoggingInterceptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
retrofit: | ||
# 连接池配置 | ||
pool: | ||
# default连接池 | ||
default: | ||
# 最大空闲连接数 | ||
max-idle-connections: 5 | ||
# 连接保活时间(秒) | ||
keep-alive-second: 300 | ||
|
||
# 是否禁用void返回值类型 | ||
disable-void-return-type: false | ||
|
||
|
||
# 全局转换器工厂 | ||
global-converter-factories: | ||
- com.github.lianjiatech.retrofit.spring.boot.core.BasicTypeConverterFactory | ||
- retrofit2.converter.jackson.JacksonConverterFactory | ||
# 全局调用适配器工厂 | ||
global-call-adapter-factories: | ||
- com.github.lianjiatech.retrofit.spring.boot.core.BodyCallAdapterFactory | ||
- com.github.lianjiatech.retrofit.spring.boot.core.ResponseCallAdapterFactory | ||
|
||
# 日志打印配置 | ||
log: | ||
# 启用日志打印 | ||
enable: true | ||
# 日志打印拦截器 | ||
logging-interceptor: com.github.lianjiatech.retrofit.spring.boot.interceptor.DefaultLoggingInterceptor | ||
# 全局日志打印级别 | ||
global-log-level: info | ||
# 全局日志打印策略 | ||
global-log-strategy: basic | ||
|
||
|
||
# 重试配置 | ||
retry: | ||
# 是否启用全局重试 | ||
enable-global-retry: false | ||
# 全局重试间隔时间 | ||
global-interval-ms: 100 | ||
# 全局最大重试次数 | ||
global-max-retries: 2 | ||
# 全局重试规则 | ||
global-retry-rules: | ||
- response_status_not_2xx | ||
- occur_io_exception | ||
# 重试拦截器 | ||
retry-interceptor: com.github.lianjiatech.retrofit.spring.boot.retry.DefaultRetryInterceptor | ||
|
||
# 熔断降级配置 | ||
degrade: | ||
# 是否启用熔断降级 | ||
enable: false | ||
# 熔断降级实现方式 | ||
degrade-type: sentinel | ||
# 熔断资源名称解析器 | ||
resource-name-parser: com.github.lianjiatech.retrofit.spring.boot.degrade.DefaultResourceNameParser | ||
# 全局连接超时时间 | ||
global-connect-timeout-ms: 10000 | ||
# 全局读取超时时间 | ||
global-read-timeout-ms: 10000 | ||
# 全局写入超时时间 | ||
global-write-timeout-ms: 10000 | ||
# 全局完整调用超时时间 | ||
global-call-timeout-ms: 0 |