Commit 20d83c89 authored by suhuiguang's avatar suhuiguang

1.升级适配redisxinttiao

parent fab8e387
...@@ -8,7 +8,6 @@ import org.apache.http.impl.client.BasicCredentialsProvider; ...@@ -8,7 +8,6 @@ import org.apache.http.impl.client.BasicCredentialsProvider;
import org.elasticsearch.client.RestClient; import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder; import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient; import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
...@@ -26,8 +25,7 @@ public class ElasticSearchClientConfig { ...@@ -26,8 +25,7 @@ public class ElasticSearchClientConfig {
@Value("${elasticsearch.password}") @Value("${elasticsearch.password}")
private String password; private String password;
@Bean @Bean(destroyMethod = "close")
@Qualifier("highLevelClient")
public RestHighLevelClient restHighLevelClient() { public RestHighLevelClient restHighLevelClient() {
final CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(AuthScope.ANY, credentialsProvider.setCredentials(AuthScope.ANY,
......
...@@ -1324,12 +1324,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1324,12 +1324,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
result.setTotal(totle); result.setTotal(totle);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
try {
restHighLevelClient.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
} }
return result; return result;
} }
......
...@@ -312,12 +312,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin ...@@ -312,12 +312,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin
result.setTotal(totle); result.setTotal(totle);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
try {
restHighLevelClient.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
} }
return result; return result;
......
...@@ -877,12 +877,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -877,12 +877,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
result.setTotal(totle); result.setTotal(totle);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
try {
restHighLevelClient.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
} }
return result; return result;
......
...@@ -14,7 +14,7 @@ eureka.instance.ip-address=172.16.3.34 ...@@ -14,7 +14,7 @@ eureka.instance.ip-address=172.16.3.34
## ES properties: ## ES properties:
elasticsearch.username=elastic elasticsearch.username=elastic
elasticsearch.password=a123456 elasticsearch.password=a123456
spring.elasticsearch.rest.uris=http:/172.16.10.230:9200 spring.elasticsearch.rest.uris=http://172.16.10.230:9200
## unit(h) ## unit(h)
alertcall.es.synchrony.time=48 alertcall.es.synchrony.time=48
#redis properties: #redis properties:
......
...@@ -26,7 +26,7 @@ public class ElasticSearchClientConfig { ...@@ -26,7 +26,7 @@ public class ElasticSearchClientConfig {
@Value("${elasticsearch.password}") @Value("${elasticsearch.password}")
private String password; private String password;
@Bean @Bean(destroyMethod = "close")
@Qualifier("highLevelClient") @Qualifier("highLevelClient")
public RestHighLevelClient restHighLevelClient() { public RestHighLevelClient restHighLevelClient() {
final CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
......
...@@ -1323,12 +1323,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1323,12 +1323,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
result.setTotal(totle); result.setTotal(totle);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
try {
restHighLevelClient.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
} }
return result; return result;
} }
......
...@@ -315,12 +315,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin ...@@ -315,12 +315,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin
result.setTotal(totle); result.setTotal(totle);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
try {
restHighLevelClient.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
} }
return result; return result;
......
...@@ -947,12 +947,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -947,12 +947,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
result.setTotal(totle); result.setTotal(totle);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
try {
restHighLevelClient.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
} }
return result; return result;
......
...@@ -14,7 +14,7 @@ eureka.instance.ip-address=172.16.3.34 ...@@ -14,7 +14,7 @@ eureka.instance.ip-address=172.16.3.34
## ES properties: ## ES properties:
elasticsearch.username=elastic elasticsearch.username=elastic
elasticsearch.password=a123456 elasticsearch.password=a123456
spring.elasticsearch.rest.uris=http:/172.16.10.230:9200 spring.elasticsearch.rest.uris=http://172.16.10.230:9200
## unit(h) ## unit(h)
alertcall.es.synchrony.time=48 alertcall.es.synchrony.time=48
#redis properties: #redis properties:
......
...@@ -8,7 +8,6 @@ import org.apache.http.impl.client.BasicCredentialsProvider; ...@@ -8,7 +8,6 @@ import org.apache.http.impl.client.BasicCredentialsProvider;
import org.elasticsearch.client.RestClient; import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder; import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient; import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
...@@ -26,7 +25,7 @@ public class ElasticSearchClientConfig { ...@@ -26,7 +25,7 @@ public class ElasticSearchClientConfig {
@Value("${elasticsearch.password}") @Value("${elasticsearch.password}")
private String password; private String password;
@Bean @Bean(destroyMethod = "close")
public RestHighLevelClient restHighLevelClient() { public RestHighLevelClient restHighLevelClient() {
final CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(AuthScope.ANY, credentialsProvider.setCredentials(AuthScope.ANY,
......
...@@ -1323,12 +1323,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1323,12 +1323,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
result.setTotal(totle); result.setTotal(totle);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
try {
restHighLevelClient.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
} }
return result; return result;
} }
......
...@@ -313,12 +313,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin ...@@ -313,12 +313,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin
result.setTotal(totle); result.setTotal(totle);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
try {
restHighLevelClient.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
} }
return result; return result;
......
...@@ -878,12 +878,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -878,12 +878,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
result.setTotal(totle); result.setTotal(totle);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
}finally {
try {
restHighLevelClient.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
} }
return result; return result;
......
...@@ -14,7 +14,7 @@ eureka.instance.ip-address=172.16.3.34 ...@@ -14,7 +14,7 @@ eureka.instance.ip-address=172.16.3.34
## ES properties: ## ES properties:
elasticsearch.username=elastic elasticsearch.username=elastic
elasticsearch.password=a123456 elasticsearch.password=a123456
spring.elasticsearch.rest.uris=http:/172.16.10.230:9200 spring.elasticsearch.rest.uris=http://172.16.10.230:9200
## unit(h) ## unit(h)
alertcall.es.synchrony.time=48 alertcall.es.synchrony.time=48
#redis properties: #redis properties:
......
...@@ -8,10 +8,10 @@ import org.apache.http.impl.client.BasicCredentialsProvider; ...@@ -8,10 +8,10 @@ import org.apache.http.impl.client.BasicCredentialsProvider;
import org.elasticsearch.client.RestClient; import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder; import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient; import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import java.util.Arrays; import java.util.Arrays;
@Configuration @Configuration
...@@ -25,7 +25,7 @@ public class ElasticSearchClientConfig { ...@@ -25,7 +25,7 @@ public class ElasticSearchClientConfig {
@Value("${elasticsearch.password}") @Value("${elasticsearch.password}")
private String password; private String password;
@Bean @Bean(destroyMethod = "close")
public RestHighLevelClient restHighLevelClient() { public RestHighLevelClient restHighLevelClient() {
final CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(AuthScope.ANY, credentialsProvider.setCredentials(AuthScope.ANY,
......
...@@ -1324,12 +1324,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1324,12 +1324,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
result.setTotal(totle); result.setTotal(totle);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
try {
restHighLevelClient.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
} }
return result; return result;
} }
......
...@@ -314,12 +314,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin ...@@ -314,12 +314,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin
result.setTotal(totle); result.setTotal(totle);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
try {
restHighLevelClient.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
} }
return result; return result;
......
...@@ -876,12 +876,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -876,12 +876,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
result.setTotal(totle); result.setTotal(totle);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
try {
restHighLevelClient.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
} }
return result; return result;
......
...@@ -15,7 +15,7 @@ eureka.instance.ip-address=172.16.3.34 ...@@ -15,7 +15,7 @@ eureka.instance.ip-address=172.16.3.34
## ES properties: ## ES properties:
elasticsearch.username=elastic elasticsearch.username=elastic
elasticsearch.password=a123456 elasticsearch.password=a123456
spring.elasticsearch.rest.uris=http:/172.16.10.230:9200 spring.elasticsearch.rest.uris=http://172.16.10.230:9200
## unit(h) ## unit(h)
alertcall.es.synchrony.time=48 alertcall.es.synchrony.time=48
#redis properties: #redis properties:
...@@ -27,6 +27,7 @@ spring.redis.lettuce.pool.max-active=200 ...@@ -27,6 +27,7 @@ spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1 spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10 spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0 spring.redis.lettuce.pool.min-idle=0
spring.redis.mode=cluster
## emqx properties: ## emqx properties:
emqx.clean-session=false emqx.clean-session=false
......
...@@ -8,7 +8,6 @@ import org.apache.http.impl.client.BasicCredentialsProvider; ...@@ -8,7 +8,6 @@ import org.apache.http.impl.client.BasicCredentialsProvider;
import org.elasticsearch.client.RestClient; import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder; import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient; import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
...@@ -26,8 +25,7 @@ public class ElasticSearchClientConfig { ...@@ -26,8 +25,7 @@ public class ElasticSearchClientConfig {
@Value("${elasticsearch.password}") @Value("${elasticsearch.password}")
private String password; private String password;
@Bean @Bean(destroyMethod = "close")
@Qualifier("highLevelClient")
public RestHighLevelClient restHighLevelClient() { public RestHighLevelClient restHighLevelClient() {
final CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(AuthScope.ANY, credentialsProvider.setCredentials(AuthScope.ANY,
......
...@@ -313,12 +313,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin ...@@ -313,12 +313,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin
result.setTotal(totle); result.setTotal(totle);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
try {
restHighLevelClient.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
} }
return result; return result;
......
...@@ -877,12 +877,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -877,12 +877,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
result.setTotal(totle); result.setTotal(totle);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
try {
restHighLevelClient.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
} }
return result; return result;
......
...@@ -15,7 +15,7 @@ eureka.instance.ip-address=172.16.3.34 ...@@ -15,7 +15,7 @@ eureka.instance.ip-address=172.16.3.34
## ES properties: ## ES properties:
elasticsearch.username=elastic elasticsearch.username=elastic
elasticsearch.password=a123456 elasticsearch.password=a123456
spring.elasticsearch.rest.uris=http:/172.16.10.230:9200 spring.elasticsearch.rest.uris=http://172.16.10.230:9200
## unit(h) ## unit(h)
alertcall.es.synchrony.time=48 alertcall.es.synchrony.time=48
#redis properties: #redis properties:
......
...@@ -28,6 +28,10 @@ ...@@ -28,6 +28,10 @@
<artifactId>poi-ooxml</artifactId> <artifactId>poi-ooxml</artifactId>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
</exclusion> </exclusion>
<exclusion>
<groupId>com.yeejoin</groupId>
<artifactId>amos-component-security</artifactId>
</exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
...@@ -65,6 +69,11 @@ ...@@ -65,6 +69,11 @@
<artifactId>logstash-logback-encoder</artifactId> <artifactId>logstash-logback-encoder</artifactId>
<version>6.3</version> <version>6.3</version>
</dependency> </dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-component-security</artifactId>
<version>${amos.version.tzs}</version>
</dependency>
</dependencies> </dependencies>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment