修改生产环境配置
This commit is contained in:
@@ -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
|
||||
prefer-ip-address: true
|
||||
adminApi:
|
||||
host: 172.17.35.163
|
||||
port: 92
|
||||
schema: http
|
||||
baseUrl: ${adminApi.schema}://ADMINAPI
|
||||
ormsStandsUrl: ${adminApi.baseUrl}/basicdata/ormsStands
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user