From: Kai Moritz Date: Wed, 6 Mar 2024 09:23:53 +0000 (+0100) Subject: refactor: Removed config-dependencies from `ChannelTaskExecutor` X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=4d534ff4199f9e5da926993044ed5a131dff6822;p=demos%2Fkafka%2Fchat refactor: Removed config-dependencies from `ChannelTaskExecutor` --- diff --git a/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/ChannelTaskExecutor.java b/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/ChannelTaskExecutor.java index 636c03bc..45206779 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/ChannelTaskExecutor.java +++ b/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/ChannelTaskExecutor.java @@ -1,7 +1,6 @@ package de.juplo.kafka.chat.backend.implementation.kafka; import de.juplo.kafka.chat.backend.implementation.kafka.messages.AbstractMessageTo; -import jakarta.annotation.PreDestroy; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -37,7 +36,6 @@ public class ChannelTaskExecutor }); } - @PreDestroy public void join() { log.info("Signaling the consumer-task for {} to quit its work", channel); 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 54aa41f1..b28b6903 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 @@ -54,7 +54,7 @@ public class KafkaServicesConfiguration dataChannelTaskExecutor); } - @Bean + @Bean(destroyMethod = "join") ChannelTaskExecutor infoChannelTaskExecutor( ThreadPoolTaskExecutor taskExecutor, InfoChannel infoChannel, @@ -84,7 +84,7 @@ public class KafkaServicesConfiguration }; } - @Bean + @Bean(destroyMethod = "join") ChannelTaskExecutor dataChannelTaskExecutor( ThreadPoolTaskExecutor taskExecutor, DataChannel dataChannel,