-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Closed
Description
This yaml :
spring:
redis:
sentinel:
master: mymaster
nodes: "[2409:aaa:5a00::fdfb:1:aaa]:26379,[2409:80aaa50:5a00::fdfb:1:bbb]:26379,[2409:aaa:5a00::fdfb:1:ccc]:26379"
but fails with:
Caused by: java.lang.NumberFormatException: For input string: "aaa:5a00::fdfb:1:aaa]:26379"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_331]
at java.lang.Integer.parseInt(Integer.java:580) ~[?:1.8.0_331]
at java.lang.Integer.parseInt(Integer.java:615) ~[?:1.8.0_331]
at org.springframework.boot.autoconfigure.data.redis.RedisConnectionConfiguration.createSentinels(RedisConnectionConfiguration.java:150) ~[spring-boot-autoconfigure-2.7.4.jar:2.7.4]
at org.springframework.boot.autoconfigure.data.redis.RedisConnectionConfiguration.getSentinelConfig(RedisConnectionConfiguration.java:97) ~[spring-boot-autoconfigure-2.7.4.jar:2.7.4]
This issue is somewhat similar to #28133 and spring-projects/spring-data-redis#2418 (comment)
spring boot autoconfigure ipv6 address all split by ":"
private List<RedisNode> createSentinels(RedisProperties.Sentinel sentinel) {
List<RedisNode> nodes = new ArrayList<>();
for (String node : sentinel.getNodes()) {
try {
String[] parts = StringUtils.split(node, ":");
Assert.state(parts.length == 2, "Must be defined as 'host:port'");
nodes.add(new RedisNode(parts[0], Integer.parseInt(parts[1])));
}
catch (RuntimeException ex) {
throw new IllegalStateException("Invalid redis sentinel property '" + node + "'", ex);
}
}
return nodes;
}
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug