From eb329060650fc10fe879e588539bf47495579b4e Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Wed, 6 Mar 2024 10:23:53 +0100 Subject: [PATCH] refactor: Removed config-dependencies from `ChannelTaskExecutor` --- .../backend/implementation/kafka/ChannelTaskExecutor.java | 2 -- .../implementation/kafka/KafkaServicesConfiguration.java | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) 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, -- 2.20.1