Search in sources :

Example 1 with DefaultMessageListener

use of com.minchul.springkafkastudy.consumer.listener.DefaultMessageListener in project spring-kafka-study by MinChul-Son.

the class MessageListenerContainerConfig method kafkaMessageListenerContainer.

@Bean
public KafkaMessageListenerContainer<String, String> kafkaMessageListenerContainer() {
    ContainerProperties containerProps = new ContainerProperties("test4");
    containerProps.setGroupId("test4-container");
    containerProps.setAckMode(ContainerProperties.AckMode.BATCH);
    containerProps.setMessageListener(new DefaultMessageListener());
    KafkaMessageListenerContainer<String, String> container = new KafkaMessageListenerContainer<>(containerFactory(), containerProps);
    container.setAutoStartup(false);
    return container;
}
Also used : DefaultMessageListener(com.minchul.springkafkastudy.consumer.listener.DefaultMessageListener) ContainerProperties(org.springframework.kafka.listener.ContainerProperties) KafkaMessageListenerContainer(org.springframework.kafka.listener.KafkaMessageListenerContainer) Bean(org.springframework.context.annotation.Bean)

Aggregations

DefaultMessageListener (com.minchul.springkafkastudy.consumer.listener.DefaultMessageListener)1 Bean (org.springframework.context.annotation.Bean)1 ContainerProperties (org.springframework.kafka.listener.ContainerProperties)1 KafkaMessageListenerContainer (org.springframework.kafka.listener.KafkaMessageListenerContainer)1