fix: BFI金蝶Feign读超时改为可配置并默认提升至120秒

This commit is contained in:
刘泉佳
2026-11-04 18:26:59 +08:00
parent 9f1eda6f4d
commit c47931bb24
5 changed files with 20 additions and 2 deletions
@@ -69,8 +69,9 @@ public class BfiFeignClientConfig {
}
@Bean
public Request.Options options() {
return new Request.Options(10, TimeUnit.SECONDS, 60, TimeUnit.SECONDS, true);
public Request.Options options(BfiProperties properties) {
return new Request.Options(properties.getConnectTimeoutSeconds(), TimeUnit.SECONDS,
properties.getReadTimeoutSeconds(), TimeUnit.SECONDS, true);
}
@Bean
@@ -64,6 +64,14 @@ public class BfiProperties {
* 语言字串,默认 zh_CN
*/
private String language = "zh_CN";
/**
* Feign 连接超时秒数,默认 10 秒
*/
private long connectTimeoutSeconds = 10;
/**
* Feign 读超时秒数,默认 120 秒:金蝶保存类接口偶发超 60 秒,超时后远端可能已生成单据,重推会自动勾稽防重
*/
private long readTimeoutSeconds = 120;
/**
* 是否启用 mock 模式(开发调试用):开启后 IBfiClient 走本地桩目录(有桩用桩、无桩透传真实接口,见 BfiClientMock)
*/