K
- the key type.V
- the value type.public class ConcurrentMessageListenerContainer<K,V> extends AbstractMessageListenerContainer<K,V>
KafkaMessageListenerContainer
s based on
concurrency
. If the
ContainerProperties
is configured with TopicPartition
s,
the TopicPartition
s are distributed evenly across the
instances.AbstractMessageListenerContainer.AckMode
logger
Constructor and Description |
---|
ConcurrentMessageListenerContainer(ConsumerFactory<K,V> consumerFactory,
ContainerProperties containerProperties)
Construct an instance with the supplied configuration properties.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doStart() |
protected void |
doStop(java.lang.Runnable callback) |
int |
getConcurrency() |
java.util.List<KafkaMessageListenerContainer<K,V>> |
getContainers()
Return the list of
KafkaMessageListenerContainer s created by
this container. |
void |
setConcurrency(int concurrency)
The maximum number of concurrent
KafkaMessageListenerContainer s running. |
java.lang.String |
toString() |
createConsumerRebalanceListener, getApplicationEventPublisher, getBeanName, getContainerProperties, getPhase, isAutoStartup, isRunning, setApplicationEventPublisher, setAutoStartup, setBeanName, setPhase, setRunning, setupMessageListener, start, stop, stop
public ConcurrentMessageListenerContainer(ConsumerFactory<K,V> consumerFactory, ContainerProperties containerProperties)
KafkaMessageListenerContainer
s.consumerFactory
- the consumer factory.containerProperties
- the container properties.public int getConcurrency()
public void setConcurrency(int concurrency)
KafkaMessageListenerContainer
s running.
Messages from within the same partition will be processed sequentially.concurrency
- the concurrency.public java.util.List<KafkaMessageListenerContainer<K,V>> getContainers()
KafkaMessageListenerContainer
s created by
this container.KafkaMessageListenerContainer
s created by
this container.protected void doStart()
doStart
in class AbstractMessageListenerContainer<K,V>
protected void doStop(java.lang.Runnable callback)
doStop
in class AbstractMessageListenerContainer<K,V>
public java.lang.String toString()
toString
in class java.lang.Object