import org.springframework.context.annotation.Configuration;
import java.util.Properties;
+import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@Bean
public EndlessConsumer endlessConsumer(
KafkaConsumer<String, String> kafkaConsumer,
+ ExecutorService executor,
ApplicationProperties properties)
{
return
new EndlessConsumer(
- Executors.newFixedThreadPool(1),
+ executor,
properties.getClientId(),
properties.getTopic(),
kafkaConsumer);
}
+ @Bean
+ public ExecutorService executor()
+ {
+ return Executors.newSingleThreadExecutor();
+ }
+
@Bean(destroyMethod = "close")
public KafkaConsumer<String, String> kafkaConsumer(ApplicationProperties properties)
{