import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import javax.annotation.PreDestroy;
@Override
public void run(ApplicationArguments args) throws Exception
- {
- start();
- }
-
- @Async
- public void start()
{
log.info("Starting SimpleConsumer");
simpleConsumer.run();
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.common.errors.WakeupException;
+import org.springframework.scheduling.annotation.Async;
import java.time.Duration;
import java.util.Arrays;
private long consumed = 0;
+ @Async
public void run()
{
try