K
- the key type.V
- the value type.S
- the target KafkaMessageDrivenChannelAdapterSpec
implementation type.public class KafkaMessageDrivenChannelAdapterSpec<K,V,S extends KafkaMessageDrivenChannelAdapterSpec<K,V,S>> extends MessageProducerSpec<S,KafkaMessageDrivenChannelAdapter<K,V>> implements ComponentsRegistration
MessageProducerSpec
implementation for the KafkaMessageDrivenChannelAdapter
.Modifier and Type | Class and Description |
---|---|
static class |
KafkaMessageDrivenChannelAdapterSpec.KafkaMessageDrivenChannelAdapterListenerContainerSpec<K,V>
A
ConcurrentMessageListenerContainer configuration
KafkaMessageDrivenChannelAdapterSpec extension. |
PARSER, target
logger
DEFAULT_PHASE
OBJECT_TYPE_ATTRIBUTE
Modifier and Type | Method and Description |
---|---|
S |
ackDiscarded(boolean ackDiscarded)
A
boolean flag to indicate if
FilteringMessageListenerAdapter
should acknowledge discarded records or not. |
S |
batchMessageConverter(org.springframework.kafka.support.converter.BatchMessageConverter messageConverter)
Set the message converter to use with a batch-based consumer.
|
S |
filterInRetry(boolean filterInRetry)
The
boolean flag to specify the order how
RetryingMessageListenerAdapter
and
FilteringMessageListenerAdapter
are wrapped to each other, if both of them are present. |
Map<Object,String> |
getComponentsToRegister() |
S |
messageConverter(org.springframework.kafka.support.converter.MessageConverter messageConverter)
Set the message converter; must be a
RecordMessageConverter or
BatchMessageConverter depending on mode. |
S |
onPartitionsAssignedSeekCallback(java.util.function.BiConsumer<Map<org.apache.kafka.common.TopicPartition,Long>,org.springframework.kafka.listener.ConsumerSeekAware.ConsumerSeekCallback> onPartitionsAssignedCallback)
Specify a
BiConsumer for seeks management during
ConsumerSeekAware.ConsumerSeekCallback#onPartitionsAssigned(Map, ConsumerSeekAware.ConsumerSeekCallback)
call from the KafkaMessageListenerContainer . |
S |
payloadType(Class<?> payloadType)
When using a type-aware message converter (such as
StringJsonMessageConverter ,
set the payload type the converter should create. |
S |
recordFilterStrategy(org.springframework.kafka.listener.adapter.RecordFilterStrategy<K,V> recordFilterStrategy)
Specify a
RecordFilterStrategy to wrap
KafkaMessageDrivenChannelAdapter.IntegrationRecordMessageListener into
FilteringMessageListenerAdapter . |
S |
recordMessageConverter(org.springframework.kafka.support.converter.RecordMessageConverter messageConverter)
Set the message converter to use with a record-based consumer.
|
S |
recoveryCallback(org.springframework.retry.RecoveryCallback<? extends Object> recoveryCallback)
A
RecoveryCallback instance for retry operation;
if null, the exception will be thrown to the container after retries are exhausted. |
S |
retryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate)
Specify a
RetryTemplate instance to wrap
KafkaMessageDrivenChannelAdapter.IntegrationRecordMessageListener into
RetryingMessageListenerAdapter . |
autoStartup, errorChannel, errorChannel, errorMessageStrategy, id, outputChannel, outputChannel, phase, sendTimeout, shouldTrack
_this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stop
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
public S messageConverter(org.springframework.kafka.support.converter.MessageConverter messageConverter)
RecordMessageConverter
or
BatchMessageConverter
depending on mode.messageConverter
- the converter.public S recordMessageConverter(org.springframework.kafka.support.converter.RecordMessageConverter messageConverter)
messageConverter
- the converter.public S batchMessageConverter(org.springframework.kafka.support.converter.BatchMessageConverter messageConverter)
messageConverter
- the converter.public S recordFilterStrategy(org.springframework.kafka.listener.adapter.RecordFilterStrategy<K,V> recordFilterStrategy)
RecordFilterStrategy
to wrap
KafkaMessageDrivenChannelAdapter.IntegrationRecordMessageListener
into
FilteringMessageListenerAdapter
.recordFilterStrategy
- the RecordFilterStrategy
to use.public S ackDiscarded(boolean ackDiscarded)
boolean
flag to indicate if
FilteringMessageListenerAdapter
should acknowledge discarded records or not. Does not make sense if
recordFilterStrategy(RecordFilterStrategy)
isn't specified.ackDiscarded
- true to ack (commit offset for) discarded messages.public S retryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate)
RetryTemplate
instance to wrap
KafkaMessageDrivenChannelAdapter.IntegrationRecordMessageListener
into
RetryingMessageListenerAdapter
.retryTemplate
- the RetryTemplate
to use.public S recoveryCallback(org.springframework.retry.RecoveryCallback<? extends Object> recoveryCallback)
RecoveryCallback
instance for retry operation;
if null, the exception will be thrown to the container after retries are exhausted.
Does not make sense if retryTemplate(RetryTemplate)
isn't specified.recoveryCallback
- the recovery callback.public S payloadType(Class<?> payloadType)
StringJsonMessageConverter
,
set the payload type the converter should create. Defaults to Object
.payloadType
- the type.public S filterInRetry(boolean filterInRetry)
boolean
flag to specify the order how
RetryingMessageListenerAdapter
and
FilteringMessageListenerAdapter
are wrapped to each other, if both of them are present. Does not make sense if only
one of RetryTemplate
or RecordFilterStrategy
is present, or any.filterInRetry
- the order for
RetryingMessageListenerAdapter
and
FilteringMessageListenerAdapter
wrapping. Defaults to false
.public S onPartitionsAssignedSeekCallback(java.util.function.BiConsumer<Map<org.apache.kafka.common.TopicPartition,Long>,org.springframework.kafka.listener.ConsumerSeekAware.ConsumerSeekCallback> onPartitionsAssignedCallback)
BiConsumer
for seeks management during
ConsumerSeekAware.ConsumerSeekCallback#onPartitionsAssigned(Map, ConsumerSeekAware.ConsumerSeekCallback)
call from the KafkaMessageListenerContainer
.onPartitionsAssignedCallback
- the BiConsumer
to usepublic Map<Object,String> getComponentsToRegister()
getComponentsToRegister
in interface ComponentsRegistration