From 2bc60b934a642f59f01b60b6e64e253b924fae4c Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser <23085769+hiddenalpha@users.noreply.github.com> Date: Tue, 4 Jun 2024 14:07:28 +0200 Subject: [PATCH] [SDCISA-16147, #583] Fix the fix. Related: SDCISA-15633, SDCISA-15833, SDCISA-16147, https://github.com/swisspost/vertx-redisques/issues/170, https://github.com/swisspost/vertx-redisques/pull/177, https://github.com/swisspost/vertx-rest-storage/pull/186, #577, https://github.com/swisspost/vertx-redisques/pull/181, #493, https://github.com/swisspost/vertx-rest-storage/issues/188, #583 --- .../gateleen/kafka/KafkaHandler.java | 73 ++++++++++--------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/gateleen-kafka/src/main/java/org/swisspush/gateleen/kafka/KafkaHandler.java b/gateleen-kafka/src/main/java/org/swisspush/gateleen/kafka/KafkaHandler.java index 301d6921..9fd482ac 100644 --- a/gateleen-kafka/src/main/java/org/swisspush/gateleen/kafka/KafkaHandler.java +++ b/gateleen-kafka/src/main/java/org/swisspush/gateleen/kafka/KafkaHandler.java @@ -21,11 +21,14 @@ import org.swisspush.gateleen.core.validation.ValidationStatus; import org.swisspush.gateleen.validation.ValidationException; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.regex.Pattern; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenThriftyExceptionFactory; + /** * Handler class for all Kafka related requests. * @@ -53,41 +56,41 @@ public class KafkaHandler extends ConfigurationResourceConsumer { private boolean initialized = false; -// /** @deprecated Use {@link #builder()} */ -// @Deprecated -// public KafkaHandler(ConfigurationResourceManager configurationResourceManager, KafkaProducerRepository repository, -// KafkaMessageSender kafkaMessageSender, String configResourceUri, String streamingPath) { -// this(configurationResourceManager, null, repository, kafkaMessageSender, -// configResourceUri, streamingPath); -// } -// -// /** @deprecated Use {@link #builder()} */ -// @Deprecated -// public KafkaHandler(ConfigurationResourceManager configurationResourceManager, KafkaMessageValidator kafkaMessageValidator, -// KafkaProducerRepository repository, KafkaMessageSender kafkaMessageSender, String configResourceUri, -// String streamingPath) { -// this(configurationResourceManager, kafkaMessageValidator, repository, kafkaMessageSender, -// configResourceUri, streamingPath, new HashMap<>()); -// } -// -// /** @deprecated Use {@link #builder()} */ -// @Deprecated -// public KafkaHandler(ConfigurationResourceManager configurationResourceManager, KafkaProducerRepository repository, -// KafkaMessageSender kafkaMessageSender, String configResourceUri, String streamingPath, Map properties) { -// -// this(configurationResourceManager, null, repository, kafkaMessageSender, -// configResourceUri, streamingPath, properties); -// } -// -// /** @deprecated Use {@link #builder()} */ -// @Deprecated -// public KafkaHandler(ConfigurationResourceManager configurationResourceManager, KafkaMessageValidator kafkaMessageValidator, KafkaProducerRepository repository, -// KafkaMessageSender kafkaMessageSender, String configResourceUri, String streamingPath, Map properties) { -// this(Vertx.vertx(), newGateleenThriftyExceptionFactory(), configurationResourceManager, -// kafkaMessageValidator, repository, kafkaMessageSender, configResourceUri, streamingPath, -// properties); -// log.warn("TODO: Do NOT use this DEPRECATED constructor! It creates instances that it should not create!"); -// } + /** @deprecated Use {@link #builder()} */ + @Deprecated + public KafkaHandler(ConfigurationResourceManager configurationResourceManager, KafkaProducerRepository repository, + KafkaMessageSender kafkaMessageSender, String configResourceUri, String streamingPath) { + this(configurationResourceManager, null, repository, kafkaMessageSender, + configResourceUri, streamingPath); + } + + /** @deprecated Use {@link #builder()} */ + @Deprecated + public KafkaHandler(ConfigurationResourceManager configurationResourceManager, KafkaMessageValidator kafkaMessageValidator, + KafkaProducerRepository repository, KafkaMessageSender kafkaMessageSender, String configResourceUri, + String streamingPath) { + this(configurationResourceManager, kafkaMessageValidator, repository, kafkaMessageSender, + configResourceUri, streamingPath, new HashMap<>()); + } + + /** @deprecated Use {@link #builder()} */ + @Deprecated + public KafkaHandler(ConfigurationResourceManager configurationResourceManager, KafkaProducerRepository repository, + KafkaMessageSender kafkaMessageSender, String configResourceUri, String streamingPath, Map properties) { + + this(configurationResourceManager, null, repository, kafkaMessageSender, + configResourceUri, streamingPath, properties); + } + + /** @deprecated Use {@link #builder()} */ + @Deprecated + public KafkaHandler(ConfigurationResourceManager configurationResourceManager, KafkaMessageValidator kafkaMessageValidator, KafkaProducerRepository repository, + KafkaMessageSender kafkaMessageSender, String configResourceUri, String streamingPath, Map properties) { + this(Vertx.vertx(), newGateleenThriftyExceptionFactory(), configurationResourceManager, + kafkaMessageValidator, repository, kafkaMessageSender, configResourceUri, streamingPath, + properties); + log.warn("TODO: Do NOT use this DEPRECATED constructor! It creates instances that it should not create!"); + } /** Use {@link #builder()} to get an instance. */ KafkaHandler(