Class KafkaMessageListenerContainer<K,​V>

  • Type Parameters:
    K - the key type.
    V - the value type.
    All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationEventPublisherAware, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, ConsumerPauseResumeEventPublisher, GenericMessageListenerContainer<K,​V>, MessageListenerContainer

    public class KafkaMessageListenerContainer<K,​V>
    extends AbstractMessageListenerContainer<K,​V>
    implements ConsumerPauseResumeEventPublisher
    Single-threaded Message listener container using the Java Consumer supporting auto-partition assignment or user-configured assignment.

    With the latter, initial partition offsets can be provided.

    • Constructor Detail

      • KafkaMessageListenerContainer

        public KafkaMessageListenerContainer​(ConsumerFactory<? super K,​? super V> consumerFactory,
                                             ContainerProperties containerProperties)
        Construct an instance with the supplied configuration properties.
        Parameters:
        consumerFactory - the consumer factory.
        containerProperties - the container properties.