K
- the key type.V
- the value type.public class KafkaMessageListenerContainerSpec<K,V> extends org.springframework.integration.dsl.IntegrationComponentSpec<KafkaMessageListenerContainerSpec<K,V>,org.springframework.kafka.listener.ConcurrentMessageListenerContainer<K,V>>
ConcurrentMessageListenerContainer
.Modifier and Type | Method and Description |
---|---|
KafkaMessageListenerContainerSpec<K,V> |
ackCount(int count)
Set the number of outstanding record count after which offsets should be
committed when
ContainerProperties.AckMode#COUNT
or ContainerProperties.AckMode#COUNT_TIME is being used. |
KafkaMessageListenerContainerSpec<K,V> |
ackMode(org.springframework.kafka.listener.ContainerProperties.AckMode ackMode)
Set the ack mode to use when auto ack (in the configuration properties) is false.
|
KafkaMessageListenerContainerSpec<K,V> |
ackOnError(boolean ackOnError)
Set whether the container should ack messages that throw exceptions or not.
|
KafkaMessageListenerContainerSpec<K,V> |
ackTime(long millis)
Set the time (ms) after which outstanding offsets should be committed when
ContainerProperties.AckMode#TIME or
ContainerProperties.AckMode#COUNT_TIME is being used. |
KafkaMessageListenerContainerSpec<K,V> |
commitCallback(org.apache.kafka.clients.consumer.OffsetCommitCallback commitCallback)
Set the commit callback; by default a simple logging callback is used to log
success at DEBUG level and failures at ERROR level.
|
KafkaMessageListenerContainerSpec<K,V> |
concurrency(int concurrency)
Specify a concurrency maximum number for the
AbstractMessageListenerContainer . |
KafkaMessageListenerContainerSpec<K,V> |
consumerRebalanceListener(org.apache.kafka.clients.consumer.ConsumerRebalanceListener consumerRebalanceListener)
Set the user defined
ConsumerRebalanceListener implementation. |
KafkaMessageListenerContainerSpec<K,V> |
consumerTaskExecutor(org.springframework.core.task.AsyncListenableTaskExecutor consumerTaskExecutor)
Set the executor for threads that poll the consumer.
|
KafkaMessageListenerContainerSpec<K,V> |
errorHandler(org.springframework.kafka.listener.GenericErrorHandler<?> errorHandler)
Specify an
ErrorHandler for the AbstractMessageListenerContainer . |
KafkaMessageListenerContainerSpec<K,V> |
groupId(java.lang.String groupId)
Set the group id for this container.
|
KafkaMessageListenerContainerSpec<K,V> |
id(java.lang.String id) |
KafkaMessageListenerContainerSpec<K,V> |
idleEventInterval(java.lang.Long idleEventInterval)
Set the idle event interval; when set, an event is emitted if a poll returns
no records and this interval has elapsed since a record was returned.
|
KafkaMessageListenerContainerSpec<K,V> |
pollTimeout(long pollTimeout)
Set the max time to block in the consumer waiting for records.
|
KafkaMessageListenerContainerSpec<K,V> |
shutdownTimeout(long shutdownTimeout)
Set the timeout for shutting down the container.
|
KafkaMessageListenerContainerSpec<K,V> |
syncCommits(boolean syncCommits)
Set whether or not to call consumer.commitSync() or commitAsync() when the
container is responsible for commits.
|
_this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stop
public KafkaMessageListenerContainerSpec<K,V> id(java.lang.String id)
id
in class org.springframework.integration.dsl.IntegrationComponentSpec<KafkaMessageListenerContainerSpec<K,V>,org.springframework.kafka.listener.ConcurrentMessageListenerContainer<K,V>>
public KafkaMessageListenerContainerSpec<K,V> concurrency(int concurrency)
AbstractMessageListenerContainer
.concurrency
- the concurrency maximum number.ConcurrentMessageListenerContainer.setConcurrency(int)
public KafkaMessageListenerContainerSpec<K,V> errorHandler(org.springframework.kafka.listener.GenericErrorHandler<?> errorHandler)
ErrorHandler
for the AbstractMessageListenerContainer
.errorHandler
- the ErrorHandler
.ErrorHandler
public KafkaMessageListenerContainerSpec<K,V> ackMode(org.springframework.kafka.listener.ContainerProperties.AckMode ackMode)
#setPollTimeout(long) pollTimeout
.AcknowledgingMessageListener
.
ackMode
- the ContainerProperties.AckMode
; default BATCH.ContainerProperties.AckMode
public KafkaMessageListenerContainerSpec<K,V> pollTimeout(long pollTimeout)
pollTimeout
- the timeout in ms; default 1000.ConsumerProperties.setPollTimeout(long)
public KafkaMessageListenerContainerSpec<K,V> ackCount(int count)
ContainerProperties.AckMode#COUNT
or ContainerProperties.AckMode#COUNT_TIME
is being used.count
- the countContainerProperties.setAckCount(int)
public KafkaMessageListenerContainerSpec<K,V> ackTime(long millis)
ContainerProperties.AckMode#TIME
or
ContainerProperties.AckMode#COUNT_TIME
is being used.
Should be larger than zero.millis
- the timeContainerProperties.setAckTime(long)
public KafkaMessageListenerContainerSpec<K,V> consumerTaskExecutor(org.springframework.core.task.AsyncListenableTaskExecutor consumerTaskExecutor)
consumerTaskExecutor
- the executorContainerProperties.setConsumerTaskExecutor(AsyncListenableTaskExecutor)
public KafkaMessageListenerContainerSpec<K,V> shutdownTimeout(long shutdownTimeout)
#stop(Runnable)
will block for, before
returning.shutdownTimeout
- the shutdown timeout.ContainerProperties.setShutdownTimeout(long)
public KafkaMessageListenerContainerSpec<K,V> consumerRebalanceListener(org.apache.kafka.clients.consumer.ConsumerRebalanceListener consumerRebalanceListener)
ConsumerRebalanceListener
implementation.consumerRebalanceListener
- the ConsumerRebalanceListener
instanceConsumerProperties.setConsumerRebalanceListener(ConsumerRebalanceListener)
public KafkaMessageListenerContainerSpec<K,V> commitCallback(org.apache.kafka.clients.consumer.OffsetCommitCallback commitCallback)
commitCallback
- the callback.ConsumerProperties.setCommitCallback(OffsetCommitCallback)
public KafkaMessageListenerContainerSpec<K,V> syncCommits(boolean syncCommits)
syncCommits
- true to use commitSync().ConsumerProperties.setSyncCommits(boolean)
public KafkaMessageListenerContainerSpec<K,V> idleEventInterval(java.lang.Long idleEventInterval)
idleEventInterval
- the interval.ContainerProperties.setIdleEventInterval(Long)
public KafkaMessageListenerContainerSpec<K,V> ackOnError(boolean ackOnError)
ackOnError
- whether the container should acknowledge messages that throw
exceptions.ContainerProperties.setAckOnError(boolean)
public KafkaMessageListenerContainerSpec<K,V> groupId(java.lang.String groupId)
group.id
property
provided by the consumer factory configuration.groupId
- the group id.ContainerProperties.setAckOnError(boolean)