From 009de3f23d6930eab48fdc22c16bee7049835eb6 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 17 Sep 2023 11:43:30 +0200 Subject: [PATCH] WIP:haproxy --- .../haproxy/HaproxyShardingPublisherStrategy.java | 2 +- .../implementation/kafka/KafkaServicesConfiguration.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/juplo/kafka/chat/backend/implementation/haproxy/HaproxyShardingPublisherStrategy.java b/src/main/java/de/juplo/kafka/chat/backend/implementation/haproxy/HaproxyShardingPublisherStrategy.java index 296d64fe..7835b188 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/implementation/haproxy/HaproxyShardingPublisherStrategy.java +++ b/src/main/java/de/juplo/kafka/chat/backend/implementation/haproxy/HaproxyShardingPublisherStrategy.java @@ -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; diff --git a/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/KafkaServicesConfiguration.java b/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/KafkaServicesConfiguration.java index 4f646f60..a575e07d 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/KafkaServicesConfiguration.java +++ b/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/KafkaServicesConfiguration.java @@ -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); } -- 2.20.1