WIP:haproxy
authorKai Moritz <kai@juplo.de>
Sun, 17 Sep 2023 09:43:30 +0000 (11:43 +0200)
committerKai Moritz <kai@juplo.de>
Sun, 17 Sep 2023 09:43:30 +0000 (11:43 +0200)
src/main/java/de/juplo/kafka/chat/backend/implementation/haproxy/HaproxyShardingPublisherStrategy.java
src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/KafkaServicesConfiguration.java

index 296d64f..7835b18 100644 (file)
@@ -13,7 +13,7 @@ import java.net.URI;
 @Slf4j
 public class HaproxyShardingPublisherStrategy implements ShardingPublisherStrategy
 {
-  private final URI runtimeApiUri;
+  private final String instanceId;
   private final WebClient webClient;
 
 
index 4f646f6..a575e07 100644 (file)
@@ -285,10 +285,12 @@ public class KafkaServicesConfiguration
   @Bean
   ShardingPublisherStrategy shardingPublisherStrategy(
       ChatBackendProperties properties,
-      WebClient webClient)
+      WebClient.Builder webClientBuilder)
   {
+    String baseUrl = properties.getHaproxyRuntimeApiUri().toASCIIString();
+    WebClient webClient = webClientBuilder.baseUrl(baseUrl).build();
     return new HaproxyShardingPublisherStrategy(
-        properties.getHaproxyRuntimeApiUri(),
+        properties.getHaproxyInstanceId(),
         webClient);
   }