public class KafkaListenerEndpointRegistrar
extends java.lang.Object
implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean
KafkaListenerEndpoint with
a KafkaListenerEndpointRegistry.KafkaListenerConfigurer| Constructor and Description |
|---|
KafkaListenerEndpointRegistrar() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
KafkaListenerEndpointRegistry |
getEndpointRegistry()
Return the
KafkaListenerEndpointRegistry instance for this
registrar, may be null. |
org.springframework.messaging.handler.annotation.support.MessageHandlerMethodFactory |
getMessageHandlerMethodFactory()
Return the custom
MessageHandlerMethodFactory to use, if any. |
protected void |
registerAllEndpoints() |
void |
registerEndpoint(KafkaListenerEndpoint endpoint)
Register a new
KafkaListenerEndpoint using the default
KafkaListenerContainerFactory to create the underlying container. |
void |
registerEndpoint(KafkaListenerEndpoint endpoint,
KafkaListenerContainerFactory<?> factory)
Register a new
KafkaListenerEndpoint alongside the
KafkaListenerContainerFactory to use to create the underlying container. |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
A
BeanFactory only needs to be available in conjunction with
setContainerFactoryBeanName(java.lang.String). |
void |
setContainerFactory(KafkaListenerContainerFactory<?> containerFactory)
Set the
KafkaListenerContainerFactory to use in case a KafkaListenerEndpoint
is registered with a null container factory. |
void |
setContainerFactoryBeanName(java.lang.String containerFactoryBeanName)
Set the bean name of the
KafkaListenerContainerFactory to use in case
a KafkaListenerEndpoint is registered with a null container factory. |
void |
setEndpointRegistry(KafkaListenerEndpointRegistry endpointRegistry)
Set the
KafkaListenerEndpointRegistry instance to use. |
void |
setMessageHandlerMethodFactory(org.springframework.messaging.handler.annotation.support.MessageHandlerMethodFactory kafkaHandlerMethodFactory)
Set the
MessageHandlerMethodFactory to use to configure the message
listener responsible to serve an endpoint detected by this processor. |
public void setEndpointRegistry(KafkaListenerEndpointRegistry endpointRegistry)
KafkaListenerEndpointRegistry instance to use.endpointRegistry - the KafkaListenerEndpointRegistry instance to use.public KafkaListenerEndpointRegistry getEndpointRegistry()
KafkaListenerEndpointRegistry instance for this
registrar, may be null.KafkaListenerEndpointRegistry instance for this
registrar, may be null.public void setMessageHandlerMethodFactory(org.springframework.messaging.handler.annotation.support.MessageHandlerMethodFactory kafkaHandlerMethodFactory)
MessageHandlerMethodFactory to use to configure the message
listener responsible to serve an endpoint detected by this processor.
By default, DefaultMessageHandlerMethodFactory is used and it
can be configured further to support additional method arguments
or to customize conversion and validation support. See
DefaultMessageHandlerMethodFactory javadoc for more details.
kafkaHandlerMethodFactory - the MessageHandlerMethodFactory instance.public org.springframework.messaging.handler.annotation.support.MessageHandlerMethodFactory getMessageHandlerMethodFactory()
MessageHandlerMethodFactory to use, if any.MessageHandlerMethodFactory to use, if any.public void setContainerFactory(KafkaListenerContainerFactory<?> containerFactory)
KafkaListenerContainerFactory to use in case a KafkaListenerEndpoint
is registered with a null container factory.
Alternatively, the bean name of the KafkaListenerContainerFactory to use
can be specified for a lazy lookup, see setContainerFactoryBeanName(java.lang.String).
containerFactory - the KafkaListenerContainerFactory instance.public void setContainerFactoryBeanName(java.lang.String containerFactoryBeanName)
KafkaListenerContainerFactory to use in case
a KafkaListenerEndpoint is registered with a null container factory.
Alternatively, the container factory instance can be registered directly:
see setContainerFactory(KafkaListenerContainerFactory).containerFactoryBeanName - the KafkaListenerContainerFactory bean name.setBeanFactory(org.springframework.beans.factory.BeanFactory)public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
BeanFactory only needs to be available in conjunction with
setContainerFactoryBeanName(java.lang.String).setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwarebeanFactory - the BeanFactory instance.public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanprotected void registerAllEndpoints()
public void registerEndpoint(KafkaListenerEndpoint endpoint, KafkaListenerContainerFactory<?> factory)
KafkaListenerEndpoint alongside the
KafkaListenerContainerFactory to use to create the underlying container.
The factory may be null if the default factory has to be
used for that endpoint.
endpoint - the KafkaListenerEndpoint instance to register.factory - the KafkaListenerContainerFactory to use.public void registerEndpoint(KafkaListenerEndpoint endpoint)
KafkaListenerEndpoint using the default
KafkaListenerContainerFactory to create the underlying container.endpoint - the KafkaListenerEndpoint instance to register.setContainerFactory(KafkaListenerContainerFactory),
registerEndpoint(KafkaListenerEndpoint, KafkaListenerContainerFactory)