Class KafkaInboundChannelAdapterSpec<K,V>

java.lang.Object
org.springframework.integration.dsl.IntegrationComponentSpec<KafkaInboundChannelAdapterSpec<K,V>, KafkaMessageSource<K,V>>
org.springframework.integration.dsl.MessageSourceSpec<KafkaInboundChannelAdapterSpec<K,V>, KafkaMessageSource<K,V>>
org.springframework.integration.kafka.dsl.KafkaInboundChannelAdapterSpec<K,V>
Type Parameters:
K - the key type.
V - the value type.
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<KafkaMessageSource<K,V>>, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

public class KafkaInboundChannelAdapterSpec<K,V> extends org.springframework.integration.dsl.MessageSourceSpec<KafkaInboundChannelAdapterSpec<K,V>, KafkaMessageSource<K,V>>
Spec for a polled Apache Kafka inbound channel adapter.
Since:
5.4
  • Field Summary

    Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec

    logger, PARSER, target

    Fields inherited from interface org.springframework.beans.factory.FactoryBean

    OBJECT_TYPE_ATTRIBUTE

    Fields inherited from interface org.springframework.context.SmartLifecycle

    DEFAULT_PHASE
  • Method Summary

    Modifier and Type
    Method
    Description
    messageConverter(org.springframework.kafka.support.converter.RecordMessageConverter messageConverter)
    Set the message converter to replace the default.
    payloadType(Class<?> type)
    Set the payload type.
    rawMessageHeader(boolean rawMessageHeader)
    Set to true to include the raw ConsumerRecord as headers with keys KafkaHeaders.RAW_DATA and IntegrationMessageHeaderAccessor.SOURCE_DATA.

    Methods inherited from class org.springframework.integration.dsl.MessageSourceSpec

    messageHeaders

    Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec

    _this, afterPropertiesSet, destroy, doGet, getId, getObject, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stop

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.beans.factory.FactoryBean

    isSingleton

    Methods inherited from interface org.springframework.context.SmartLifecycle

    isPauseable, pause, restart
  • 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.