Interface KafkaInboundEndpoint

All Known Implementing Classes:
KafkaInboundGateway, KafkaMessageDrivenChannelAdapter

public interface KafkaInboundEndpoint
Implementations of this interface will generally support a retry template for retrying incoming deliveries and this supports adding common attributes to the retry context.
Since:
6.0
Author:
Gary Russell
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    static final String
    RetryContext attribute key for an acknowledgment if the listener is capable of acknowledging.
    static final String
    RetryContext attribute key for the consumer if the listener is consumer-aware.
    static final String
    RetryContext attribute key for the record.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    doWithRetry(org.springframework.retry.support.RetryTemplate template, org.springframework.retry.RecoveryCallback<?> callback, org.apache.kafka.clients.consumer.ConsumerRecord<?,?> record, org.springframework.kafka.support.Acknowledgment acknowledgment, org.apache.kafka.clients.consumer.Consumer<?,?> consumer, Runnable runnable)
    Execute the runnable with the retry template and recovery callback.
  • Field Details

    • CONTEXT_ACKNOWLEDGMENT

      static final String CONTEXT_ACKNOWLEDGMENT
      RetryContext attribute key for an acknowledgment if the listener is capable of acknowledging.
      See Also:
    • CONTEXT_CONSUMER

      static final String CONTEXT_CONSUMER
      RetryContext attribute key for the consumer if the listener is consumer-aware.
      See Also:
    • CONTEXT_RECORD

      static final String CONTEXT_RECORD
      RetryContext attribute key for the record.
      See Also:
    • ATTRIBUTES_HOLDER

      static final ThreadLocal<AttributeAccessor> ATTRIBUTES_HOLDER
  • Method Details

    • doWithRetry

      default void doWithRetry(org.springframework.retry.support.RetryTemplate template, org.springframework.retry.RecoveryCallback<?> callback, org.apache.kafka.clients.consumer.ConsumerRecord<?,?> record, org.springframework.kafka.support.Acknowledgment acknowledgment, org.apache.kafka.clients.consumer.Consumer<?,?> consumer, Runnable runnable)
      Execute the runnable with the retry template and recovery callback.
      Parameters:
      template - the template.
      callback - the callback.
      record - the record (or records).
      acknowledgment - the acknowledgment.
      consumer - the consumer.
      runnable - the runnable.