From fa4d644bf84b6fec92a3f5b20125146e529daa05 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 24 Feb 2024 18:41:44 +0100 Subject: [PATCH] WIP:setup --- .../haproxy/HaproxyShardingPublisherStrategy.java | 3 +-- .../chat/backend/implementation/kafka/DataChannel.java | 3 ++- src/test/resources/haproxy.cfg | 8 -------- 3 files changed, 3 insertions(+), 11 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 3caaeb38..ad71d497 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 @@ -5,7 +5,6 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import reactor.core.publisher.Mono; -import java.io.IOException; import java.net.SocketAddress; import java.nio.ByteBuffer; import java.nio.channels.SocketChannel; @@ -33,7 +32,7 @@ public class HaproxyShardingPublisherStrategy implements ShardingPublisherStrate socketChannel.close(); return Mono.just(instanceId); } - catch (IOException e) + catch (Exception e) { return Mono.error(e); } diff --git a/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/DataChannel.java b/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/DataChannel.java index f139b765..2287a337 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/DataChannel.java +++ b/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/DataChannel.java @@ -152,7 +152,8 @@ public class DataChannel implements Runnable, ConsumerRebalanceListener "Could not publish instance {} as owner of shard {}: {}", instanceId, partition, - throwable)) + throwable.toString())) + .onErrorComplete() .block(); }); diff --git a/src/test/resources/haproxy.cfg b/src/test/resources/haproxy.cfg index b73e97c3..ad9bb8fe 100644 --- a/src/test/resources/haproxy.cfg +++ b/src/test/resources/haproxy.cfg @@ -37,11 +37,3 @@ backend backend_2 backend backend_3 server b3 backend-3:8080 check - -userlist haproxy-dataplaneapi - user juplo insecure-password juplo - -program api - command /usr/bin/dataplaneapi --host 0.0.0.0 --port 5555 --haproxy-bin /usr/sbin/haproxy --config-file /usr/local/etc/haproxy/haproxy.cfg --reload-cmd "kill -SIGUSR2 1" --restart-cmd "kill -SIGUSR2 1" --reload-delay 5 --userlist haproxy-dataplaneapi - no option start-on-reload - -- 2.20.1