K - the key type.V - the value type.public class ConcurrentKafkaListenerContainerFactory<K,V> extends AbstractKafkaListenerContainerFactory<ConcurrentMessageListenerContainer<K,V>,K,V>
KafkaListenerContainerFactory implementation to build a
ConcurrentMessageListenerContainer.
This should be the default for most users and a good transition paths for those that
are used to building such container definitions manually.
This factory is primarily for building containers for KafkaListener annotated
methods but can also be used to create any container.
Only containers for KafkaListener annotated methods are added to the
KafkaListenerEndpointRegistry.
logger| Constructor and Description |
|---|
ConcurrentKafkaListenerContainerFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected ConcurrentMessageListenerContainer<K,V> |
createContainerInstance(KafkaListenerEndpoint endpoint)
Create an empty container instance.
|
protected void |
initializeContainer(ConcurrentMessageListenerContainer<K,V> instance,
KafkaListenerEndpoint endpoint)
Further initialize the specified container.
|
void |
setConcurrency(java.lang.Integer concurrency)
Specify the container concurrency.
|
afterPropertiesSet, createContainer, createContainer, createContainer, createContainer, createListenerContainer, getConsumerFactory, getContainerProperties, isBatchListener, setAckDiscarded, setAfterRollbackProcessor, setApplicationContext, setApplicationEventPublisher, setAutoStartup, setBatchErrorHandler, setBatchListener, setConsumerFactory, setContainerCustomizer, setErrorHandler, setMessageConverter, setMissingTopicsFatal, setPhase, setRecordFilterStrategy, setRecordInterceptor, setRecoveryCallback, setReplyHeadersConfigurer, setReplyTemplate, setRetryTemplate, setStatefulRetrypublic ConcurrentKafkaListenerContainerFactory()
public void setConcurrency(java.lang.Integer concurrency)
concurrency - the number of consumers to create.ConcurrentMessageListenerContainer.setConcurrency(int)protected ConcurrentMessageListenerContainer<K,V> createContainerInstance(KafkaListenerEndpoint endpoint)
AbstractKafkaListenerContainerFactorycreateContainerInstance in class AbstractKafkaListenerContainerFactory<ConcurrentMessageListenerContainer<K,V>,K,V>endpoint - the endpoint.protected void initializeContainer(ConcurrentMessageListenerContainer<K,V> instance, KafkaListenerEndpoint endpoint)
AbstractKafkaListenerContainerFactorySubclasses can inherit from this method to apply extra configuration if necessary.
initializeContainer in class AbstractKafkaListenerContainerFactory<ConcurrentMessageListenerContainer<K,V>,K,V>instance - the container instance to configure.endpoint - the endpoint.