|
@@ -3,30 +3,19 @@ package com.nokia.domainb;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
-import org.springframework.context.annotation.Bean;
|
|
|
-import org.springframework.scheduling.concurrent.CustomizableThreadFactory;
|
|
|
+import org.springframework.core.env.Environment;
|
|
|
|
|
|
-import java.util.concurrent.ArrayBlockingQueue;
|
|
|
-import java.util.concurrent.ThreadPoolExecutor;
|
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
+import java.net.InetAddress;
|
|
|
+import java.net.UnknownHostException;
|
|
|
|
|
|
@Slf4j
|
|
|
@SpringBootApplication
|
|
|
public class DomainBApplication {
|
|
|
|
|
|
- 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;
|
|
|
+ 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"));
|
|
|
}
|
|
|
}
|