From a3fae5aca54307a1298b51ae6f3e768b3a22b524 Mon Sep 17 00:00:00 2001 From: Sumit Aich Date: Thu, 25 Apr 2024 04:22:12 +0530 Subject: [PATCH] fix: fix checkstyle (#37) * fix: fix checkstyle * fix: fix checkstyle * fix: fix checkstyle * fix: fix checkstyle --- .../gotocompany/firehose/sink/httpv2/HttpV2SinkUtils.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gotocompany/firehose/sink/httpv2/HttpV2SinkUtils.java b/src/main/java/com/gotocompany/firehose/sink/httpv2/HttpV2SinkUtils.java index 97209a655..fedbed8f4 100644 --- a/src/main/java/com/gotocompany/firehose/sink/httpv2/HttpV2SinkUtils.java +++ b/src/main/java/com/gotocompany/firehose/sink/httpv2/HttpV2SinkUtils.java @@ -8,12 +8,18 @@ public class HttpV2SinkUtils { public static void addAdditionalConfigsForHttpV2Sink(Map env) { - switch (KafkaConsumerMode.valueOf(env.getOrDefault("SOURCE_KAFKA_CONSUMER_MODE", "SYNC"))) { + System.out.println(env.getOrDefault("SOURCE_KAFKA_CONSUMER_MODE", "SYNC").toUpperCase()); + switch (KafkaConsumerMode.valueOf(env.getOrDefault("SOURCE_KAFKA_CONSUMER_MODE", "SYNC").toUpperCase())) { case SYNC: env.put("SINK_HTTPV2_MAX_CONNECTIONS", "1"); break; + case ASYNC: env.put("SINK_HTTPV2_MAX_CONNECTIONS", env.getOrDefault("SINK_POOL_NUM_THREADS", "1")); + break; + default: + throw new IllegalArgumentException("Consumer mode should be async or sync"); + } } }