Class KafkaInboundChannelAdapterSpec<K,V>

Type Parameters:
K - the key type.
V - the value type.
All Implemented Interfaces:
DisposableBean, FactoryBean<KafkaMessageSource<K,V>>, InitializingBean, Lifecycle, Phased, SmartLifecycle

public class KafkaInboundChannelAdapterSpec<K,V> extends MessageSourceSpec<KafkaInboundChannelAdapterSpec<K,V>,KafkaMessageSource<K,V>>
Spec for a polled Apache Kafka inbound channel adapter.
Since:
5.4
Author:
Gary Russell, Anshul Mehra, Artem Bilan
  • Method Details

    • messageConverter

      public KafkaInboundChannelAdapterSpec<K,V> messageConverter(org.springframework.kafka.support.converter.RecordMessageConverter messageConverter)
      Set the message converter to replace the default. MessagingMessageConverter.
      Parameters:
      messageConverter - the converter.
      Returns:
      the spec.
    • payloadType

      public KafkaInboundChannelAdapterSpec<K,V> payloadType(Class<?> type)
      Set the payload type. Only applies if a type-aware message converter is provided.
      Parameters:
      type - the type to convert to.
      Returns:
      the spec.
    • rawMessageHeader

      public KafkaInboundChannelAdapterSpec<K,V> rawMessageHeader(boolean rawMessageHeader)
      Set to true to include the raw ConsumerRecord as headers with keys KafkaHeaders.RAW_DATA and IntegrationMessageHeaderAccessor.SOURCE_DATA. enabling callers to have access to the record to process errors.
      Parameters:
      rawMessageHeader - true to include the header.
      Returns:
      the spec.