@Autowired
ApplicationProperties properties;
@Autowired
+ EndlessConsumer endlessConsumer;
+ @Autowired
RecordHandler recordHandler;
Map<TopicPartition, Long> oldOffsets;
newOffsets.put(
new TopicPartition(record.topic(), record.partition()),
record.offset());
+
+ endlessConsumer.start();
}
+ @AfterEach
+ public void deinit()
+ {
+ try
+ {
+ endlessConsumer.stop();
+ }
+ catch (Exception e)
+ {
+ log.info("Exception while stopping the consumer: {}", e.toString());
+ }
+ }
public static class RecordHandler implements Consumer<ConsumerRecord<String, Long>>
{