diff --git a/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/client/VertxRedisClientFactory.java b/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/client/VertxRedisClientFactory.java index 9cf4ec222e5d2..683c154f93b49 100644 --- a/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/client/VertxRedisClientFactory.java +++ b/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/client/VertxRedisClientFactory.java @@ -10,6 +10,7 @@ import java.net.URI; import java.util.ArrayList; import java.util.List; +import java.util.Set; import io.quarkus.arc.Arc; import io.quarkus.arc.ArcContainer; @@ -51,8 +52,9 @@ public static Redis create(String name, Vertx vertx, RedisClientConfig config) { } } else if (config.hostsProviderName.isPresent()) { RedisHostsProvider hostsProvider = findProvider(config.hostsProviderName.get()); - hosts.addAll(hostsProvider.getHosts()); - for (URI uri : hostsProvider.getHosts()) { + Set computedHosts = hostsProvider.getHosts(); + hosts.addAll(computedHosts); + for (URI uri : computedHosts) { options.addConnectionString(uri.toString()); } } else {