Class KafkaMessageDrivenChannelAdapterSpec<K,V,S extends KafkaMessageDrivenChannelAdapterSpec<K,V,S>>    
java.lang.Object
org.springframework.integration.dsl.IntegrationComponentSpec<S,P>
 
org.springframework.integration.dsl.MessageProducerSpec<S,KafkaMessageDrivenChannelAdapter<K,V>>
  
org.springframework.integration.kafka.dsl.KafkaMessageDrivenChannelAdapterSpec<K,V,S>  
- Type Parameters:
- K- the key type.
- V- the value type.
- S- the target- KafkaMessageDrivenChannelAdapterSpecimplementation type.
- All Implemented Interfaces:
- DisposableBean,- FactoryBean<KafkaMessageDrivenChannelAdapter<K,,- V>> - InitializingBean,- Lifecycle,- Phased,- SmartLifecycle,- ComponentsRegistration
- Direct Known Subclasses:
- KafkaMessageDrivenChannelAdapterSpec.KafkaMessageDrivenChannelAdapterListenerContainerSpec
public class KafkaMessageDrivenChannelAdapterSpec<K,V,S extends KafkaMessageDrivenChannelAdapterSpec<K,V,S>>    
extends MessageProducerSpec<S,KafkaMessageDrivenChannelAdapter<K,V>>
implements ComponentsRegistration  
A 
MessageProducerSpec implementation for the KafkaMessageDrivenChannelAdapter.- Since:
- 5.4
- Author:
- Artem Bilan, Gary Russell, Cameron Mayfield
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classAConcurrentMessageListenerContainerconfigurationKafkaMessageDrivenChannelAdapterSpecextension.
- 
Field SummaryFields inherited from class org.springframework.integration.dsl.IntegrationComponentSpeclogger, PARSER, targetFields inherited from interface org.springframework.beans.factory.FactoryBeanOBJECT_TYPE_ATTRIBUTEFields inherited from interface org.springframework.context.SmartLifecycleDEFAULT_PHASE
- 
Method SummaryModifier and TypeMethodDescriptionackDiscarded(boolean ackDiscarded) Abooleanflag to indicate ifFilteringMessageListenerAdaptershould acknowledge discarded records or not.batchMessageConverter(org.springframework.kafka.support.converter.BatchMessageConverter messageConverter) Set the message converter to use with a batch-based consumer.filterInRetry(boolean filterInRetry) Thebooleanflag to specify the order in which the filter and retry operations are performed.messageConverter(org.springframework.kafka.support.converter.MessageConverter messageConverter) Set the message converter; must be aRecordMessageConverterorBatchMessageConverterdepending on mode.onPartitionsAssignedSeekCallback(BiConsumer<Map<org.apache.kafka.common.TopicPartition, Long>, org.springframework.kafka.listener.ConsumerSeekAware.ConsumerSeekCallback> onPartitionsAssignedCallback) Specify aBiConsumerfor seeks management duringConsumerSeekAware.onPartitionsAssigned(Map, ConsumerSeekAware.ConsumerSeekCallback)call from theKafkaMessageListenerContainer.payloadType(Class<?> payloadType) When using a type-aware message converter (such asStringJsonMessageConverter), set the payload type the converter should create.recordFilterStrategy(org.springframework.kafka.listener.adapter.RecordFilterStrategy<K, V> recordFilterStrategy) Specify aRecordFilterStrategyto wrapKafkaMessageDrivenChannelAdapter.IntegrationRecordMessageListenerintoFilteringMessageListenerAdapter.recordMessageConverter(org.springframework.kafka.support.converter.RecordMessageConverter messageConverter) Set the message converter to use with a record-based consumer.recoveryCallback(org.springframework.retry.RecoveryCallback<?> recoveryCallback) ARecoveryCallbackinstance for retry operation; if null, the exception will be thrown to the container after retries are exhausted.retryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate) Specify aRetryTemplateinstance to use for retrying deliveries.Methods inherited from class org.springframework.integration.dsl.MessageProducerSpecautoStartup, errorChannel, errorChannel, errorMessageStrategy, id, observationConvention, outputChannel, outputChannel, phase, sendTimeout, shouldTrackMethods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec_this, afterPropertiesSet, destroy, doGet, getId, getObject, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stopMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.FactoryBeanisSingleton
- 
Method Details- 
messageConverterpublic S messageConverter(org.springframework.kafka.support.converter.MessageConverter messageConverter) Set the message converter; must be aRecordMessageConverterorBatchMessageConverterdepending on mode.- Parameters:
- messageConverter- the converter.
- Returns:
- the spec
 
- 
recordMessageConverterpublic S recordMessageConverter(org.springframework.kafka.support.converter.RecordMessageConverter messageConverter) Set the message converter to use with a record-based consumer.- Parameters:
- messageConverter- the converter.
- Returns:
- the spec
 
- 
batchMessageConverterpublic S batchMessageConverter(org.springframework.kafka.support.converter.BatchMessageConverter messageConverter) Set the message converter to use with a batch-based consumer.- Parameters:
- messageConverter- the converter.
- Returns:
- the spec
 
- 
recordFilterStrategypublic S recordFilterStrategy(org.springframework.kafka.listener.adapter.RecordFilterStrategy<K, V> recordFilterStrategy) Specify aRecordFilterStrategyto wrapKafkaMessageDrivenChannelAdapter.IntegrationRecordMessageListenerintoFilteringMessageListenerAdapter.- Parameters:
- recordFilterStrategy- the- RecordFilterStrategyto use.
- Returns:
- the spec
 
- 
ackDiscardedAbooleanflag to indicate ifFilteringMessageListenerAdaptershould acknowledge discarded records or not. Does not make sense ifrecordFilterStrategy(RecordFilterStrategy)isn't specified.- Parameters:
- ackDiscarded- true to ack (commit offset for) discarded messages.
- Returns:
- the spec
 
- 
retryTemplateSpecify aRetryTemplateinstance to use for retrying deliveries.- Parameters:
- retryTemplate- the- RetryTemplateto use.
- Returns:
- the spec
 
- 
recoveryCallbackARecoveryCallbackinstance for retry operation; if null, the exception will be thrown to the container after retries are exhausted. Does not make sense ifretryTemplate(RetryTemplate)isn't specified.- Parameters:
- recoveryCallback- the recovery callback.
- Returns:
- the spec
 
- 
payloadTypeWhen using a type-aware message converter (such asStringJsonMessageConverter), set the payload type the converter should create. Defaults toObject.- Parameters:
- payloadType- the type.
- Returns:
- the spec
 
- 
filterInRetryThebooleanflag to specify the order in which the filter and retry operations are performed. Does not make sense if only one ofRetryTemplateorRecordFilterStrategyis present, or none. When true, the filter is called for each retry; when false, the filter is only called once for each delivery from the container.- Parameters:
- filterInRetry- true to filter for each retry. Defaults to- false.
- Returns:
- the spec
 
- 
onPartitionsAssignedSeekCallbackpublic S onPartitionsAssignedSeekCallback(BiConsumer<Map<org.apache.kafka.common.TopicPartition, Long>, org.springframework.kafka.listener.ConsumerSeekAware.ConsumerSeekCallback> onPartitionsAssignedCallback) Specify aBiConsumerfor seeks management duringConsumerSeekAware.onPartitionsAssigned(Map, ConsumerSeekAware.ConsumerSeekCallback)call from theKafkaMessageListenerContainer.- Parameters:
- onPartitionsAssignedCallback- the- BiConsumerto use
- Returns:
- the spec
 
- 
getComponentsToRegister- Specified by:
- getComponentsToRegisterin interface- ComponentsRegistration
 
 
-