...
|
...
|
@@ -20,6 +20,7 @@ import org.slf4j.LoggerFactory; |
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.util.LinkedMultiValueMap;
|
|
|
import org.springframework.util.MultiValueMap;
|
...
|
...
|
@@ -62,6 +63,13 @@ public class JavaApiClient { |
|
|
JavaApiStatus javaApiStatus;
|
|
|
|
|
|
|
|
|
@Value("${JavaApiExecutorPoolCoreSize:20}")
|
|
|
private int JavaApiExecutorPoolCoreSize;
|
|
|
|
|
|
@Value("${JavaApiExecutorPoolMaxSize:50}")
|
|
|
private int JavaApiExecutorPoolMaxSize;
|
|
|
|
|
|
|
|
|
//TODO 需要 线程安全 处理 不过一般不会出现并发,任务周期比较长,一般周期内任务能够完成
|
|
|
private Map<String, JavaApiInfo> javaApimap;
|
|
|
|
...
|
...
|
@@ -73,7 +81,8 @@ public class JavaApiClient { |
|
|
|
|
|
|
|
|
public void initClient() {
|
|
|
executorService = new ThreadPoolExecutor(10, 30, 60, TimeUnit.SECONDS, new LinkedBlockingDeque<>(),
|
|
|
executorService = new ThreadPoolExecutor(JavaApiExecutorPoolCoreSize, JavaApiExecutorPoolMaxSize,
|
|
|
60, TimeUnit.SECONDS, new LinkedBlockingDeque<>(),
|
|
|
new JavaApiThreadFactory());
|
|
|
|
|
|
completionService = new ExecutorCompletionService<JavaApiStatics>(executorService);
|
...
|
...
|
|