Class KafkaInboundChannelAdapterSpec<K,V>
java.lang.Object
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:
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
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 TypeMethodDescriptionmessageConverter
(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 rawConsumerRecord
as headers with keysKafkaHeaders.RAW_DATA
andIntegrationMessageHeaderAccessor.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, get, getId, getObject, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.FactoryBean
isSingleton
-
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 rawConsumerRecord
as headers with keysKafkaHeaders.RAW_DATA
andIntegrationMessageHeaderAccessor.SOURCE_DATA
. enabling callers to have access to the record to process errors.- Parameters:
rawMessageHeader
- true to include the header.- Returns:
- the spec.
-