Skip to content

Commit

Permalink
fix: allow multiple hosts for ES
Browse files Browse the repository at this point in the history
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier@rte-france.com>
  • Loading branch information
LE SAULNIER Kevin committed Dec 6, 2024
1 parent c7d7e2f commit b118899
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 61 deletions.

This file was deleted.

14 changes: 8 additions & 6 deletions src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ server:
spring:
rabbitmq:
addresses: localhost
data:
elasticsearch:
host: localhost
## to fill if authentication is needed
# user:
# password:
elasticsearch:
uris:
- http://localhost:9200
connection-timeout: 60s
socket-timeout: 60s
## to fill if authentication is needed
# username:
# password:
powsybl:
services:
network-store-server:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void postConstruct() {
elasticsearchContainer.start();

System.setProperty("spring.data.elasticsearch.embedded", Boolean.toString(true));
System.setProperty("spring.data.elasticsearch.embedded.port", Integer.toString(elasticsearchContainer.getMappedPort(9200)));
System.setProperty("spring.elasticsearch.uris", "localhost:".concat(Integer.toString(elasticsearchContainer.getMappedPort(9200))));
}

@PreDestroy
Expand Down

0 comments on commit b118899

Please sign in to comment.