import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.Bean;
-import org.springframework.kafka.core.ConsumerFactory;
import javax.annotation.PreDestroy;
import java.util.concurrent.ExecutionException;
@Autowired
ExecutorService executorService;
@Autowired
- Consumer<String, Message> consumer;
+ Consumer<?, ?> consumer;
@Autowired
SimpleConsumer simpleConsumer;
log.info("SimpleConsumer finished its work");
}
- @Bean(destroyMethod = "close")
- public Consumer<String, Message> kafkaConsumer(ConsumerFactory<String, Message> factory)
- {
- return factory.createConsumer();
- }
-
public static void main(String[] args)
{