From d11ce4980713a6b1fbfb8e59f8dc28d09998963c Mon Sep 17 00:00:00 2001 From: Doris Lam Date: Wed, 21 Feb 2024 11:33:01 -0800 Subject: [PATCH] set default elastic cred to null so existing deployments don't need to update properties --- .../openmbee/mms/elastic/config/ElasticsearchConfig.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/elastic/src/main/java/org/openmbee/mms/elastic/config/ElasticsearchConfig.java b/elastic/src/main/java/org/openmbee/mms/elastic/config/ElasticsearchConfig.java index 66e92cc69..be2380345 100644 --- a/elastic/src/main/java/org/openmbee/mms/elastic/config/ElasticsearchConfig.java +++ b/elastic/src/main/java/org/openmbee/mms/elastic/config/ElasticsearchConfig.java @@ -24,15 +24,15 @@ public class ElasticsearchConfig { @Value("${elasticsearch.http}") private String elasticsearchHttp; - @Value("${elasticsearch.password}") + @Value("${elasticsearch.password:#{null}}") private String elasticsearchPassword; - @Value("${elasticsearch.username}") + @Value("${elasticsearch.username:#{null}}") private String elasticsearchUsername; @Bean(name = "clientElastic", destroyMethod = "close") public RestHighLevelClient restClient() { - + RestClientBuilder builder = RestClient.builder(new HttpHost(elasticsearchHost, elasticsearchPort, elasticsearchHttp)); builder.setRequestConfigCallback(requestConfigBuilder -> requestConfigBuilder.setConnectTimeout(10000).setSocketTimeout(1000000));