Browse Source

增加OkHttp配置文件读取

tags/v1.0.0^2
林万龙 3 years ago
parent
commit
61e158e0db
2 changed files with 19 additions and 1 deletions
  1. +17
    -0
      src/main/java/com/telpo/dipperposition/config/AsyncExecutorConfig.java
  2. +2
    -1
      src/main/java/com/telpo/dipperposition/server/DipperPositionServer.java

+ 17
- 0
src/main/java/com/telpo/dipperposition/config/AsyncExecutorConfig.java View File

@@ -1,5 +1,7 @@
package com.telpo.dipperposition.config; package com.telpo.dipperposition.config;


import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@@ -17,6 +19,8 @@ import java.util.concurrent.ThreadPoolExecutor;
* @author: linwl * @author: linwl
* @create: 2020-07-11 09:17 * @create: 2020-07-11 09:17
*/ */
@Getter
@Setter
@Configuration @Configuration
@Slf4j @Slf4j
public class AsyncExecutorConfig implements AsyncConfigurer { public class AsyncExecutorConfig implements AsyncConfigurer {
@@ -30,6 +34,19 @@ public class AsyncExecutorConfig implements AsyncConfigurer {
@Value("${async.pool.queueCapacity}") @Value("${async.pool.queueCapacity}")
private int 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") @Bean(name = "asyncServiceExecutor")
public Executor asyncServiceExecutor() { public Executor asyncServiceExecutor() {
log.info("start asyncServiceExecutor"); log.info("start asyncServiceExecutor");


+ 2
- 1
src/main/java/com/telpo/dipperposition/server/DipperPositionServer.java View File

@@ -1,6 +1,7 @@
package com.telpo.dipperposition.server; package com.telpo.dipperposition.server;


import com.telpo.dipperposition.co.PositionConfigInfo; import com.telpo.dipperposition.co.PositionConfigInfo;
import com.telpo.dipperposition.config.AsyncExecutorConfig;
import com.telpo.dipperposition.config.PositionConfig; import com.telpo.dipperposition.config.PositionConfig;
import com.telpo.dipperposition.handler.ServerChannelInitializer; import com.telpo.dipperposition.handler.ServerChannelInitializer;
import com.telpo.dipperposition.service.IDipperDataAsyncTaskService; import com.telpo.dipperposition.service.IDipperDataAsyncTaskService;
@@ -27,7 +28,7 @@ import java.net.InetSocketAddress;
public class DipperPositionServer { public class DipperPositionServer {


@Autowired @Autowired
PositionConfigInfo positionConfig;
AsyncExecutorConfig positionConfig;
/* /*
* 时间同步进程线程 * 时间同步进程线程
*/ */


Loading…
Cancel
Save