diff --git a/src/main/resources/application-pro.yml b/src/main/resources/application-pro.yml index f83a28cd..f16f2aea 100644 --- a/src/main/resources/application-pro.yml +++ b/src/main/resources/application-pro.yml @@ -13,14 +13,14 @@ spring: test-on-borrow: true initial-size: 3 redis: + cluster: + nodes: 172.17.35.160:6379,172.17.35.160:6380,172.17.35.161:6379,172.17.35.161:6380,172.17.35.162:6379,172.17.35.162:6380 password: - port: 6379 pool: max-idle: 10 min-idle: 0 max-active: 200 max-wait: -1 - host: 172.17.35.165 timeout: 1000 kafka: producer: @@ -92,4 +92,10 @@ eureka: service-url: defaultZone: http://172.17.35.163:94/eureka/ instance: - prefer-ip-address: true \ No newline at end of file + prefer-ip-address: true +adminApi: + host: 172.17.35.163 + port: 92 + schema: http + baseUrl: ${adminApi.schema}://ADMINAPI + ormsStandsUrl: ${adminApi.baseUrl}/basicdata/ormsStands \ No newline at end of file diff --git a/src/test/java/com/gzzn/omms/msgexchangeapi/runner/ScheduledExecutorServiceTest.java b/src/test/java/com/gzzn/omms/msgexchangeapi/runner/ScheduledExecutorServiceTest.java new file mode 100644 index 00000000..650d0f4f --- /dev/null +++ b/src/test/java/com/gzzn/omms/msgexchangeapi/runner/ScheduledExecutorServiceTest.java @@ -0,0 +1,38 @@ +package com.gzzn.omms.msgexchangeapi.runner; + +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class ScheduledExecutorServiceTest { + + @Test + public void testRun() + { + //启动消息采集线程 + ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1); + scheduledExecutorService.scheduleAtFixedRate(new Runnable() { + @Override + public void run() { + System.out.println("start ..."); + try { + Thread.sleep(3000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + System.out.println("end ..."); + } + }, 0, 1 , TimeUnit.SECONDS); + + while (true) { + + } + }//end function +}