K - the key type.V - the value type.public class KafkaMessageDrivenChannelAdapter<K,V>
extends org.springframework.integration.endpoint.MessageProducerSupport
implements org.springframework.integration.context.OrderlyShutdownCapable
| Constructor and Description |
|---|
KafkaMessageDrivenChannelAdapter(org.springframework.kafka.listener.AbstractMessageListenerContainer<K,V> messageListenerContainer) |
| Modifier and Type | Method and Description |
|---|---|
int |
afterShutdown() |
int |
beforeShutdown() |
protected void |
doStart() |
protected void |
doStop() |
java.lang.String |
getComponentType() |
protected void |
onInit() |
void |
setAckDiscarded(boolean ackDiscarded)
A
boolean flag to indicate if FilteringAcknowledgingMessageListenerAdapter
should acknowledge discarded records or not. |
void |
setFilterInRetry(boolean filterInRetry)
The
boolean flag to specify the order how
RetryingAcknowledgingMessageListenerAdapter and
FilteringAcknowledgingMessageListenerAdapter are wrapped to each other,
if both of them are present. |
void |
setMessageConverter(org.springframework.kafka.support.converter.MessageConverter messageConverter) |
void |
setRecordFilterStrategy(org.springframework.kafka.listener.adapter.RecordFilterStrategy<K,V> recordFilterStrategy)
Specify a
RecordFilterStrategy to wrap
KafkaMessageDrivenChannelAdapter.IntegrationMessageListener into
FilteringAcknowledgingMessageListenerAdapter. |
void |
setRecoveryCallback(org.springframework.retry.RecoveryCallback<java.lang.Void> recoveryCallback)
A
RecoveryCallback instance for retry operation;
if null, the exception will be thrown to the container after retries are exhausted. |
void |
setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate)
Specify a
RetryTemplate instance to wrap
KafkaMessageDrivenChannelAdapter.IntegrationMessageListener into
RetryingAcknowledgingMessageListenerAdapter. |
getMessagingTemplate, sendMessage, setErrorChannel, setOutputChannel, setSendTimeout, setShouldTrackdoStop, getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stopafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, toStringpublic void setMessageConverter(org.springframework.kafka.support.converter.MessageConverter messageConverter)
public void setRecordFilterStrategy(org.springframework.kafka.listener.adapter.RecordFilterStrategy<K,V> recordFilterStrategy)
RecordFilterStrategy to wrap
KafkaMessageDrivenChannelAdapter.IntegrationMessageListener into
FilteringAcknowledgingMessageListenerAdapter.recordFilterStrategy - the RecordFilterStrategy to use.public void setAckDiscarded(boolean ackDiscarded)
boolean flag to indicate if FilteringAcknowledgingMessageListenerAdapter
should acknowledge discarded records or not.
Does not make sense if setRecordFilterStrategy(RecordFilterStrategy) isn't specified.ackDiscarded - true to ack (commit offset for) discarded messages.public void setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate)
RetryTemplate instance to wrap
KafkaMessageDrivenChannelAdapter.IntegrationMessageListener into
RetryingAcknowledgingMessageListenerAdapter.retryTemplate - the RetryTemplate to use.public void setRecoveryCallback(org.springframework.retry.RecoveryCallback<java.lang.Void> 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 setRetryTemplate(RetryTemplate) isn't specified.recoveryCallback - the recovery callback.public void setFilterInRetry(boolean filterInRetry)
boolean flag to specify the order how
RetryingAcknowledgingMessageListenerAdapter and
FilteringAcknowledgingMessageListenerAdapter 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 RetryingAcknowledgingMessageListenerAdapter and
FilteringAcknowledgingMessageListenerAdapter wrapping. Defaults to false.protected void onInit()
onInit in class org.springframework.integration.endpoint.MessageProducerSupportprotected void doStart()
doStart in class org.springframework.integration.endpoint.MessageProducerSupportprotected void doStop()
doStop in class org.springframework.integration.endpoint.MessageProducerSupportpublic java.lang.String getComponentType()
getComponentType in interface org.springframework.integration.support.context.NamedComponentgetComponentType in class org.springframework.integration.context.IntegrationObjectSupportpublic int beforeShutdown()
beforeShutdown in interface org.springframework.integration.context.OrderlyShutdownCapablepublic int afterShutdown()
afterShutdown in interface org.springframework.integration.context.OrderlyShutdownCapable