mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-29 13:39:16 +00:00
Validate node configuration with static master replica
See gh-47401 Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>
This commit is contained in:
committed by
Stéphane Nicoll
parent
8a9528ebdc
commit
4fd9626854
+1
@@ -154,6 +154,7 @@ abstract class DataRedisConnectionConfiguration {
|
||||
}
|
||||
if (this.connectionDetails.getMasterReplica() != null) {
|
||||
List<Node> nodes = this.connectionDetails.getMasterReplica().getNodes();
|
||||
Assert.state(!nodes.isEmpty(), "At least one node is required for master-replica configuration");
|
||||
RedisStaticMasterReplicaConfiguration config = new RedisStaticMasterReplicaConfiguration(
|
||||
nodes.get(0).host(), nodes.get(0).port());
|
||||
nodes.stream().skip(1).forEach((node) -> config.addNode(node.host(), node.port()));
|
||||
|
||||
Reference in New Issue
Block a user