From 61e158e0db26809a2a9369b851a584f9c465bd2f Mon Sep 17 00:00:00 2001 From: linwl <304115325@qq.com> Date: Fri, 15 Jan 2021 17:20:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0OkHttp=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=AF=BB=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/AsyncExecutorConfig.java | 17 +++++++++++++++++ .../server/DipperPositionServer.java | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/telpo/dipperposition/config/AsyncExecutorConfig.java b/src/main/java/com/telpo/dipperposition/config/AsyncExecutorConfig.java index 9806f31..e3d8c6b 100644 --- a/src/main/java/com/telpo/dipperposition/config/AsyncExecutorConfig.java +++ b/src/main/java/com/telpo/dipperposition/config/AsyncExecutorConfig.java @@ -1,5 +1,7 @@ package com.telpo.dipperposition.config; +import lombok.Getter; +import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; import org.springframework.beans.factory.annotation.Value; @@ -17,6 +19,8 @@ import java.util.concurrent.ThreadPoolExecutor; * @author: linwl * @create: 2020-07-11 09:17 */ +@Getter +@Setter @Configuration @Slf4j public class AsyncExecutorConfig implements AsyncConfigurer { @@ -30,6 +34,19 @@ public class AsyncExecutorConfig implements AsyncConfigurer { @Value("${async.pool.queueCapacity}") private int queueCapacity; + + @Value(value = "${position.server.serverAddr}") + private String serverAddr; + + @Value(value = "${position.server.timeAsycPort}") + private String timeAsycServerPort; + + @Value(value = "${position.server.posAsycPort}") + private String posAsycServerPort; + + @Value(value = "${position.server.starsAsycPort}") + private String starsAsycServerPort; + @Bean(name = "asyncServiceExecutor") public Executor asyncServiceExecutor() { log.info("start asyncServiceExecutor"); diff --git a/src/main/java/com/telpo/dipperposition/server/DipperPositionServer.java b/src/main/java/com/telpo/dipperposition/server/DipperPositionServer.java index a0fa877..82f5759 100644 --- a/src/main/java/com/telpo/dipperposition/server/DipperPositionServer.java +++ b/src/main/java/com/telpo/dipperposition/server/DipperPositionServer.java @@ -1,6 +1,7 @@ package com.telpo.dipperposition.server; import com.telpo.dipperposition.co.PositionConfigInfo; +import com.telpo.dipperposition.config.AsyncExecutorConfig; import com.telpo.dipperposition.config.PositionConfig; import com.telpo.dipperposition.handler.ServerChannelInitializer; import com.telpo.dipperposition.service.IDipperDataAsyncTaskService; @@ -27,7 +28,7 @@ import java.net.InetSocketAddress; public class DipperPositionServer { @Autowired - PositionConfigInfo positionConfig; + AsyncExecutorConfig positionConfig; /* * 时间同步进程线程 */