From: Kai Moritz Date: Fri, 17 Feb 2023 18:12:27 +0000 (+0100) Subject: WIP X-Git-Tag: kafkadata~46 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=b6139d1ca213e297c4b5bc9b7cb3606ab2d2f67a;p=demos%2Fkafka%2Fchat WIP --- diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/ChatroomInactiveMessageHandlingStrategy.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/ChatroomInactiveMessageHandlingStrategy.java new file mode 100644 index 00000000..430d6ef8 --- /dev/null +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/ChatroomInactiveMessageHandlingStrategy.java @@ -0,0 +1,19 @@ +package de.juplo.kafka.chat.backend.persistence.kafka; + +import de.juplo.kafka.chat.backend.domain.Message; +import lombok.RequiredArgsConstructor; +import org.apache.kafka.common.TopicPartition; + + +@RequiredArgsConstructor +class ChatroomInactiveMessageHandlingStrategy implements MessageHandlingStrategy +{ + private final TopicPartition tp; + + @Override + public MessageHandlingStrategy handleMessage(Message message) + { + KafkaChatHomeService.log.warn("Not handling message {} for partition {}", message, tp); + return this; + } +} diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/NoOpMessageHandlingStrategy.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/NoOpMessageHandlingStrategy.java deleted file mode 100644 index c25418a8..00000000 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/NoOpMessageHandlingStrategy.java +++ /dev/null @@ -1,19 +0,0 @@ -package de.juplo.kafka.chat.backend.persistence.kafka; - -import de.juplo.kafka.chat.backend.domain.Message; -import lombok.RequiredArgsConstructor; -import org.apache.kafka.common.TopicPartition; - - -@RequiredArgsConstructor -class NoOpMessageHandlingStrategy implements MessageHandlingStrategy -{ - private final TopicPartition tp; - - @Override - public MessageHandlingStrategy handleMessage(Message message) - { - KafkaChatHomeService.log.warn("Not handling message {} for partition {}", message, tp); - return this; - } -}