From 30bce85c7bc5597e1ae41ef891bb00f763ceed67 Mon Sep 17 00:00:00 2001 From: zhouxiunai <154707516@qq.com> Date: Mon, 18 Mar 2019 18:26:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC=E5=8F=B7?= =?UTF-8?q?=E4=B8=BA0.8.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jenkins/Jenkinsfile | 2 +- pom.xml | 2 +- src/main/resources/application-local.yml | 102 ++++++++++++++++++ src/main/resources/application-pro.yml | 8 +- src/main/resources/application-test.yml | 102 ++++++++++++++++++ .../flightInfo/FlightHisServiceImplTest.java | 2 +- 6 files changed, 210 insertions(+), 8 deletions(-) create mode 100644 src/main/resources/application-local.yml create mode 100644 src/main/resources/application-test.yml diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index d057a8c4..38b56237 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -1,7 +1,7 @@ node { def mailto="154707516@qq.com" //邮件接收人员列表 def containerName="msgexchangeapi" //容器名称 - def imageVersion="0.0.1-SNAPSHOT" + def imageVersion="0.8.1-SNAPSHOT" def imageName="130.120.3.193/com.gzzn.omms/msgexchange-api:${imageVersion}" //镜像名称 def credentialsId="e41b57a4-436a-4617-817c-9e3f25a8a47f" //ssh证书id def deployHost="130.120.3.231" //发布到的主机 diff --git a/pom.xml b/pom.xml index fa61747b..76616027 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.gzzn.omms msgexchange-api - 0.0.1-SNAPSHOT + 0.8.1-SNAPSHOT jar msgexchange-api diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml new file mode 100644 index 00000000..92c5dbf7 --- /dev/null +++ b/src/main/resources/application-local.yml @@ -0,0 +1,102 @@ +spring: + jpa: + hibernate: + ddl-auto: none + naming: + physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl + datasource: + username: cdairport + password: 123456 + url: jdbc:mysql://130.120.3.158:3306/cdairport?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&autoReconnect=true + tomcat: + max-active: 30 + test-on-borrow: true + initial-size: 3 + redis: + cluster: + nodes: 130.120.3.234:6379,130.120.3.234:6380,130.120.3.236:6379,130.120.3.236:6380,130.120.3.238:6379,130.120.3.238:6380 + password: + pool: + max-idle: 10 + min-idle: 0 + max-active: 200 + max-wait: -1 + timeout: 1000 +kafka: + producer: + retries: 0 + servers: 130.120.3.234:9092,130.120.3.236:9092,130.120.3.238:9092 + linger: 1 + batch: + size: 4096 + buffer: + memory: 10240000 + max: + request: + size: 10240000 + consumer: + auto: + offset: + reset: latest + commit: + interval: 100 + servers: 130.120.3.234:9092,130.120.3.236:9092,130.120.3.238:9092 + zookeeper: + connect: 130.120.3.234:2181,130.120.3.236:2182,130.120.3.238:2183 + session: + timeout: 6000 + enable: + auto: + commit: true + topic: test + concurrency: 10 + group: + id: test +msgExchange: + intervalSeconds: 1 + waitDateLeftOffset: 600000 +logstash: + host: 130.120.3.234:5000 +scheduled: + #每日凌晨3:30分点采集历史数据 0 30 3 * * ? + flightInfoCron: 0 30 3 * * ? + corePoolSize: 10 + maxPoolSize: 50 + queueCapacity: 10 + # 每日凌晨3:00 cminmsg 已处理数据转历史 + cminmsgHisCron: 0 0 3 * * ? + # 航班发送信息定时 + flightSendCron: "*/3 * * * * ?" +#计入历史航班数据的条件 +hstCondition: + #航班到达超过多久则成为历史航班数据(单位:毫秒) + ARRIVE_HST_TIME: 3600000 + #航班取消超过多久则成为历史航班数据(单位:毫秒) + CANCEL_HST_TIME: 3600000 + #备降超过多久则成为历史航班数据 FROM CTU 本应降落到成都备降到其他地方(单位:毫秒) + FDIV_HST_TIME: 59400000 + #计划时间超过多久则成为历史航班数据(单位:毫秒) + SODT_HST_TIME: 259200000 + +# Elasticsearch +# 9200端口是用来让HTTP REST API来访问ElasticSearch,而9300端口是传输层监听的默认端口 +elasticsearch: + ip: 130.120.3.234 + port: 9300 + pool: 5 + #注意cluster.name需要与config/elasticsearch.yml中的cluster.name一致 + cluster: + name: docker-cluster +eureka: + client: + service-url: + defaultZone: http://130.120.3.231:94/eureka/ + instance: + prefer-ip-address: true +adminApi: + host: 130.120.3.231 + port: 92 + schema: http + baseUrl: ${adminApi.schema}://${adminApi.host}:${adminApi.port} + ormsStandsUrl: ${adminApi.baseUrl}/basicdata/ormsStands + getAirbridgeCodeByStandCodeUrl: ${adminApi.baseUrl}/basicdata/ormsStands/{standCode}/airbridgeCode \ No newline at end of file diff --git a/src/main/resources/application-pro.yml b/src/main/resources/application-pro.yml index b3d91c1a..aaa1169c 100644 --- a/src/main/resources/application-pro.yml +++ b/src/main/resources/application-pro.yml @@ -25,7 +25,7 @@ spring: kafka: producer: retries: 0 - servers: 172.17.35.161:9092,172.17.35.161:9092,172.17.35.161:9092 + servers: 172.17.35.160:9092,172.17.35.161:9092,172.17.35.162:9092 linger: 1 batch: size: 4096 @@ -40,9 +40,9 @@ kafka: reset: latest commit: interval: 100 - servers: 172.17.35.161:9092,172.17.35.161:9092,172.17.35.161:9092 + servers: 172.17.35.160:9092,172.17.35.161:9092,172.17.35.162:9092 zookeeper: - connect: 172.17.35.161:2181 + connect: 172.17.35.160:2181,172.17.35.161:2182,172.17.35.162:2183 session: timeout: 6000 enable: @@ -96,8 +96,6 @@ eureka: prefer-ip-address: false hostName: msgexchangeapi adminApi: - host: 172.17.35.163 - port: 92 schema: http baseUrl: ${adminApi.schema}://ADMINAPI ormsStandsUrl: ${adminApi.baseUrl}/basicdata/ormsStands diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml new file mode 100644 index 00000000..65d7dfdf --- /dev/null +++ b/src/main/resources/application-test.yml @@ -0,0 +1,102 @@ +spring: + jpa: + hibernate: + ddl-auto: none + naming: + physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl + datasource: + username: cdairport + password: 123456 + url: jdbc:mysql://130.120.3.158:3306/cdairport?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&autoReconnect=true + tomcat: + max-active: 30 + test-on-borrow: true + initial-size: 3 + redis: + cluster: + nodes: 130.120.3.234:6379,130.120.3.234:6380,130.120.3.236:6379,130.120.3.236:6380,130.120.3.238:6379,130.120.3.238:6380 + password: + pool: + max-idle: 10 + min-idle: 0 + max-active: 200 + max-wait: -1 + timeout: 1000 +kafka: + producer: + retries: 0 + servers: 130.120.3.234:9092,130.120.3.236:9092,130.120.3.238:9092 + linger: 1 + batch: + size: 4096 + buffer: + memory: 10240000 + max: + request: + size: 10240000 + consumer: + auto: + offset: + reset: latest + commit: + interval: 100 + servers: 130.120.3.234:9092,130.120.3.236:9092,130.120.3.238:9092 + zookeeper: + connect: 130.120.3.234:2181,130.120.3.236:2182,130.120.3.238:2183 + session: + timeout: 6000 + enable: + auto: + commit: true + topic: test + concurrency: 10 + group: + id: test +msgExchange: + intervalSeconds: 1 + waitDateLeftOffset: 600000 +logstash: + host: 130.120.3.234:5000 +scheduled: + #每日凌晨3:30分点采集历史数据 0 30 3 * * ? + flightInfoCron: 0 30 3 * * ? + corePoolSize: 10 + maxPoolSize: 50 + queueCapacity: 10 + # 每日凌晨3:00 cminmsg 已处理数据转历史 + cminmsgHisCron: 0 0 3 * * ? + # 航班发送信息定时 + flightSendCron: "*/3 * * * * ?" +#计入历史航班数据的条件 +hstCondition: + #航班到达超过多久则成为历史航班数据(单位:毫秒) + ARRIVE_HST_TIME: 3600000 + #航班取消超过多久则成为历史航班数据(单位:毫秒) + CANCEL_HST_TIME: 3600000 + #备降超过多久则成为历史航班数据 FROM CTU 本应降落到成都备降到其他地方(单位:毫秒) + FDIV_HST_TIME: 59400000 + #计划时间超过多久则成为历史航班数据(单位:毫秒) + SODT_HST_TIME: 259200000 + +# Elasticsearch +# 9200端口是用来让HTTP REST API来访问ElasticSearch,而9300端口是传输层监听的默认端口 +elasticsearch: + ip: 130.120.3.234 + port: 9300 + pool: 5 + #注意cluster.name需要与config/elasticsearch.yml中的cluster.name一致 + cluster: + name: docker-cluster + nodes: 130.120.3.234:9300,130.120.3.236:9300,130.120.3.238:9300 +eureka: + client: + service-url: + defaultZone: http://130.120.3.232:94/eureka/ + instance: + prefer-ip-address: false + hostName: msgexchangeapi +adminApi: + schema: http + baseUrl: ${adminApi.schema}://ADMINAPI + ormsStandsUrl: ${adminApi.baseUrl}/basicdata/ormsStands + getAirbridgeCodeByStandCodeUrl: ${adminApi.baseUrl}/basicdata/ormsStands/{standCode}/airbridgeCode \ No newline at end of file diff --git a/src/test/java/com/gzzn/omms/msgexchangeapi/service/flightInfo/FlightHisServiceImplTest.java b/src/test/java/com/gzzn/omms/msgexchangeapi/service/flightInfo/FlightHisServiceImplTest.java index 68995967..61b52c86 100644 --- a/src/test/java/com/gzzn/omms/msgexchangeapi/service/flightInfo/FlightHisServiceImplTest.java +++ b/src/test/java/com/gzzn/omms/msgexchangeapi/service/flightInfo/FlightHisServiceImplTest.java @@ -43,7 +43,7 @@ public class FlightHisServiceImplTest { List fltrsHis = flightHisServiceImpl.getHisToBeTran(fltrs); System.out.println("等待转历史航班动态条数:"+fltrsHis.size()); - flightHisServiceImpl.save(fltrsHis); + //flightHisServiceImpl.save(fltrsHis); assertThat(fltrsHis).isNotEmpty(); }