Browse Source

更新

feature_hph_新增rabbitmq_sink
1049970895@qniao.cn 3 years ago
parent
commit
b409957af3
2 changed files with 3 additions and 3 deletions
  1. 4
      src/main/java/com/qniao/iot/IotMonitoringDataJob.java
  2. 2
      src/main/resources/META-INF/app.properties

4
src/main/java/com/qniao/iot/IotMonitoringDataJob.java

@ -439,11 +439,11 @@ public class IotMonitoringDataJob {
searchSourceBuilder.sort("reportTime", SortOrder.DESC);
searchSourceBuilder.size(1);
// 创建查询请求对象将查询对象配置到其中
SearchRequest searchRequest = new SearchRequest(ApolloConfig.getStr(ConfigConstant.SINK_ELASTICSEARCH_INDEX) + "_*");
SearchRequest searchRequest = new SearchRequest(ApolloConfig.getStr(ConfigConstant.SINK_ELASTICSEARCH_INDEX));
searchRequest.source(searchSourceBuilder);
String nowDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMM"));
GetIndexRequest exist = new GetIndexRequest(ApolloConfig.getStr(ConfigConstant.SINK_ELASTICSEARCH_INDEX) + "_" + nowDate);
// 先判断客户端是否存在
// 先判断索引是否存在
boolean exists = restHighLevelClient.indices().exists(exist, RequestOptions.DEFAULT);
if (exists) {
// 执行查询然后处理响应结果

2
src/main/resources/META-INF/app.properties

@ -2,4 +2,4 @@ app.id=iot-device-monitoring-data
# test 8.135.8.221
# prod 47.112.164.224
apollo.meta=http://47.112.164.224:5000
apollo.meta=http://8.135.8.221:5000
Loading…
Cancel
Save