|
@@ -3,19 +3,30 @@ package com.nokia.domainb;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.boot.SpringApplication;
|
|
import org.springframework.boot.SpringApplication;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
-import org.springframework.core.env.Environment;
|
|
|
|
|
|
+import org.springframework.context.annotation.Bean;
|
|
|
|
+import org.springframework.scheduling.concurrent.CustomizableThreadFactory;
|
|
|
|
|
|
-import java.net.InetAddress;
|
|
|
|
-import java.net.UnknownHostException;
|
|
|
|
|
|
+import java.util.concurrent.ArrayBlockingQueue;
|
|
|
|
+import java.util.concurrent.ThreadPoolExecutor;
|
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
@SpringBootApplication
|
|
@SpringBootApplication
|
|
public class DomainBApplication {
|
|
public class DomainBApplication {
|
|
|
|
|
|
- public static void main(String[] args) throws UnknownHostException {
|
|
|
|
- SpringApplication app = new SpringApplication(DomainBApplication.class);
|
|
|
|
- Environment env = app.run(args).getEnvironment();
|
|
|
|
- log.info("╭( ′• o •′ )╭☞ run on http://{}:{}", InetAddress.getLocalHost().getHostAddress(),
|
|
|
|
- env.getProperty("server.port"));
|
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
|
+ SpringApplication.run(DomainBApplication.class, args);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 欠费接口整合线程池配置
|
|
|
|
+ */
|
|
|
|
+ @Bean
|
|
|
|
+ public ThreadPoolExecutor qryowefeeExecutor() {
|
|
|
|
+ ThreadPoolExecutor executor = new ThreadPoolExecutor(100, 200, 0L, TimeUnit.MILLISECONDS,
|
|
|
|
+ new ArrayBlockingQueue<>(10000), new CustomizableThreadFactory("qryowefee-"));
|
|
|
|
+ executor.prestartAllCoreThreads();
|
|
|
|
+ log.info("qryowefee poolSize: {}", executor.getPoolSize());
|
|
|
|
+ return executor;
|
|
}
|
|
}
|
|
}
|
|
}
|