|
3 | 3 | import hlf.java.rest.client.config.KafkaConsumerConfig; |
4 | 4 | import hlf.java.rest.client.config.KafkaProperties; |
5 | 5 | import hlf.java.rest.client.exception.ServiceException; |
6 | | -import java.util.ArrayList; |
7 | | -import java.util.List; |
8 | | -import java.util.concurrent.CompletableFuture; |
9 | | -import java.util.concurrent.ExecutionException; |
10 | | -import java.util.concurrent.atomic.AtomicInteger; |
11 | 6 | import lombok.Getter; |
12 | 7 | import lombok.SneakyThrows; |
13 | 8 | import lombok.extern.slf4j.Slf4j; |
|
31 | 26 | import org.springframework.kafka.support.Acknowledgment; |
32 | 27 | import org.springframework.util.CollectionUtils; |
33 | 28 |
|
| 29 | +import java.util.ArrayList; |
| 30 | +import java.util.List; |
| 31 | +import java.util.concurrent.CompletableFuture; |
| 32 | +import java.util.concurrent.ExecutionException; |
| 33 | +import java.util.concurrent.atomic.AtomicInteger; |
| 34 | + |
34 | 35 | /* |
35 | 36 | * This class is the configuration class for dynamically creating consumers to receiving the blockchain |
36 | 37 | * transaction from Kafka Topic and send it to Fabric channel. |
@@ -59,19 +60,6 @@ public class DynamicKafkaListener { |
59 | 60 | @Value("${kafka.general.consumer-shutdown-timeout-in-sec:30}") |
60 | 61 | private int shutdownTimeoutInSeconds; |
61 | 62 |
|
62 | | - // Registering a 'graceful' shutdown hook in PostConstruct |
63 | | - /* @PostConstruct |
64 | | - public void init() { |
65 | | - Runtime.getRuntime().addShutdownHook(new Thread(() -> { |
66 | | - log.info("JVM shutdown hook triggered for Kafka consumers"); |
67 | | - try { |
68 | | - performGracefulShutdown(); |
69 | | - } catch (Exception e) { |
70 | | - log.error("Error during Kafka shutdown", e); |
71 | | - } |
72 | | - })); |
73 | | - }*/ |
74 | | - |
75 | 63 | @EventListener(ContextClosedEvent.class) |
76 | 64 | public void onContextClosed() { |
77 | 65 | log.info("Application context closing, performing graceful Kafka shutdown"); |
|
0 commit comments