Class KafkaInboundChannelAdapterSpec<K,V>
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
org.springframework.integration.dsl.IntegrationComponentSpec<S,H>
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:
Aware,BeanClassLoaderAware,BeanFactoryAware,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
-
Field Summary
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
PARSER, target -
Method Summary
Modifier and Type Method Description KafkaInboundChannelAdapterSpec<K,V>messageConverter(org.springframework.kafka.support.converter.RecordMessageConverter messageConverter)Set the message converter to replace the default.KafkaInboundChannelAdapterSpec<K,V>payloadType(Class<?> type)Set the payload type.KafkaInboundChannelAdapterSpec<K,V>rawMessageHeader(boolean rawMessageHeader)Set to true to include the rawConsumerRecordas headers with keysKafkaHeaders.RAW_DATAandIntegrationMessageHeaderAccessor.SOURCE_DATA.Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stopMethods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
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
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
Set to true to include the rawConsumerRecordas headers with keysKafkaHeaders.RAW_DATAandIntegrationMessageHeaderAccessor.SOURCE_DATA. enabling callers to have access to the record to process errors.- Parameters:
rawMessageHeader- true to include the header.- Returns:
- the spec.
-