Class KafkaBackoffAwareMessageListenerAdapter<K,​V>

    • Constructor Detail

      • KafkaBackoffAwareMessageListenerAdapter

        public KafkaBackoffAwareMessageListenerAdapter​(MessageListener<K,​V> delegate,
                                                       KafkaConsumerBackoffManager kafkaConsumerBackoffManager,
                                                       java.lang.String listenerId,
                                                       java.lang.String backoffTimestampHeader,
                                                       java.time.Clock clock)
        The configuration for this listener adapter.
        Parameters:
        delegate - the MessageListener instance that will handle the messages.
        kafkaConsumerBackoffManager - the manager that will handle the back off.
        listenerId - the id of the listener container associated to this adapter.
        backoffTimestampHeader - the header name that will be looked up in the incoming record to acquire the timestamp.
        clock - the clock instance that will be used to timestamp the exception throwing.
        Since:
        2.7
    • Method Detail

      • onMessage

        public void onMessage​(org.apache.kafka.clients.consumer.ConsumerRecord<K,​V> consumerRecord,
                              @Nullable
                              Acknowledgment acknowledgment,
                              @Nullable
                              org.apache.kafka.clients.consumer.Consumer<?,​?> consumer)
        Description copied from interface: GenericMessageListener
        Invoked with data from kafka and provides access to the Consumer. The default implementation throws UnsupportedOperationException.
        Specified by:
        onMessage in interface AcknowledgingConsumerAwareMessageListener<K,​V>
        Specified by:
        onMessage in interface GenericMessageListener<K>
        Parameters:
        consumerRecord - the data to be processed.
        acknowledgment - the acknowledgment.
        consumer - the consumer.
      • onMessage

        public void onMessage​(org.apache.kafka.clients.consumer.ConsumerRecord<K,​V> data,
                              Acknowledgment acknowledgment)
        Description copied from interface: GenericMessageListener
        Invoked with data from kafka. The default implementation throws UnsupportedOperationException.
        Specified by:
        onMessage in interface GenericMessageListener<K>
        Parameters:
        data - the data to be processed.
        acknowledgment - the acknowledgment.
      • onMessage

        public void onMessage​(org.apache.kafka.clients.consumer.ConsumerRecord<K,​V> data,
                              org.apache.kafka.clients.consumer.Consumer<?,​?> consumer)
        Description copied from interface: GenericMessageListener
        Invoked with data from kafka and provides access to the Consumer. The default implementation throws UnsupportedOperationException.
        Specified by:
        onMessage in interface GenericMessageListener<K>
        Parameters:
        data - the data to be processed.
        consumer - the consumer.