Merge branch 'master' of http://42.192.7.176:3000/suojin/jonhon-mes-svr
commit
8aeb54c20d
6 changed files with 49 additions and 27 deletions
@ -0,0 +1,39 @@ |
|||||||
|
package org.springblade.scheduling.config; |
||||||
|
|
||||||
|
import feign.Request; |
||||||
|
import feign.Retryer; |
||||||
|
import org.springframework.context.annotation.Bean; |
||||||
|
import org.springframework.context.annotation.ComponentScan; |
||||||
|
import org.springframework.context.annotation.Configuration; |
||||||
|
|
||||||
|
/** |
||||||
|
* TODO:功能描述 |
||||||
|
* |
||||||
|
* @author sjx |
||||||
|
* @version 1.0 |
||||||
|
* @BelongsProject jonhon-mes-svr |
||||||
|
* @BelongsPackage org.springblade.scheduling.config |
||||||
|
* @since 2026-02-10 15:07 |
||||||
|
*/ |
||||||
|
@Configuration |
||||||
|
@ComponentScan |
||||||
|
public class NoRetryFeignConfig { |
||||||
|
/** |
||||||
|
* 配置永不重试的Retryer(Feign内置的NEVER_RETRY常量) |
||||||
|
*/ |
||||||
|
@Bean |
||||||
|
public Retryer feignRetryer() { |
||||||
|
// Retryer.NEVER_RETRY 表示:初始间隔0,最大间隔0,最大重试次数0 → 完全不重试
|
||||||
|
return Retryer.NEVER_RETRY; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 2. 显式配置超时时间(关键:覆盖默认60秒,与yml保持12秒一致) |
||||||
|
*/ |
||||||
|
@Bean |
||||||
|
public Request.Options feignRequestOptions() { |
||||||
|
int connectTimeout = 5 * 60 * 1000; // 300000ms
|
||||||
|
int readTimeout = 24 * 60 * 60 * 1000; // 86400000ms
|
||||||
|
return new Request.Options(connectTimeout, readTimeout); |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue