Skip to content

Commit ef0831f

Browse files
committed
DATAES-105 - support for IP6
1 parent b2f0300 commit ef0831f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/main/java/org/springframework/data/elasticsearch/client/TransportClientFactoryBean.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ protected void buildClient() throws Exception {
8989
client = TransportClient.builder().settings(settings()).build();
9090
Assert.hasText(clusterNodes, "[Assertion failed] clusterNodes settings missing.");
9191
for (String clusterNode : split(clusterNodes, COMMA)) {
92-
String hostName = substringBefore(clusterNode, COLON);
93-
String port = substringAfter(clusterNode, COLON);
92+
String hostName = substringBeforeLast(clusterNode, COLON);
93+
String port = substringAfterLast(clusterNode, COLON);
9494
Assert.hasText(hostName, "[Assertion failed] missing host name in 'clusterNodes'");
9595
Assert.hasText(port, "[Assertion failed] missing port in 'clusterNodes'");
9696
logger.info("adding transport node : " + clusterNode);

src/test/resources/infrastructure.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
http-enabled="false" path-data="target/elasticsearchTestData" path-home="src/test/resources/test-home-dir"
1010
path-configuration="node-client-configuration.yml"/>
1111

12+
<!-- ip4 -->
1213
<!--<elasticsearch:transport-client id="client" cluster-name="elasticsearch" cluster-nodes="127.0.0.1:9300" />-->
1314

15+
<!-- ip6 -->
16+
<!--<elasticsearch:transport-client id="client" cluster-name="elasticsearch" cluster-nodes="[::1]:9300" />-->
17+
1418
</beans>

0 commit comments

Comments
 (0)