public class RabbitListenerEndpointRegistrar extends Object implements BeanFactoryAware, InitializingBean
RabbitListenerEndpoint with
a RabbitListenerEndpointRegistry.RabbitListenerConfigurer| Constructor and Description |
|---|
RabbitListenerEndpointRegistrar() |
public void setEndpointRegistry(RabbitListenerEndpointRegistry endpointRegistry)
RabbitListenerEndpointRegistry instance to use.endpointRegistry - the RabbitListenerEndpointRegistry instance to use.@Nullable public RabbitListenerEndpointRegistry getEndpointRegistry()
RabbitListenerEndpointRegistry instance for this
registrar, may be null.public void setMessageHandlerMethodFactory(MessageHandlerMethodFactory rabbitHandlerMethodFactory)
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.
rabbitHandlerMethodFactory - the MessageHandlerMethodFactory instance.public MessageHandlerMethodFactory getMessageHandlerMethodFactory()
MessageHandlerMethodFactory to use, if any.public void setContainerFactory(RabbitListenerContainerFactory<?> containerFactory)
RabbitListenerContainerFactory to use in case a RabbitListenerEndpoint
is registered with a null container factory.
Alternatively, the bean name of the RabbitListenerContainerFactory to use
can be specified for a lazy lookup, see setContainerFactoryBeanName(java.lang.String).
containerFactory - the RabbitListenerContainerFactory instance.public void setContainerFactoryBeanName(String containerFactoryBeanName)
RabbitListenerContainerFactory to use in case
a RabbitListenerEndpoint is registered with a null container factory.
Alternatively, the container factory instance can be registered directly:
see setContainerFactory(RabbitListenerContainerFactory).containerFactoryBeanName - the RabbitListenerContainerFactory bean name.setBeanFactory(org.springframework.beans.factory.BeanFactory)public void setBeanFactory(BeanFactory beanFactory)
BeanFactory only needs to be available in conjunction with
setContainerFactoryBeanName(java.lang.String).setBeanFactory in interface BeanFactoryAwarebeanFactory - the BeanFactory instance.public void afterPropertiesSet()
afterPropertiesSet in interface InitializingBeanprotected void registerAllEndpoints()
public void registerEndpoint(RabbitListenerEndpoint endpoint, @Nullable RabbitListenerContainerFactory<?> factory)
RabbitListenerEndpoint alongside the
RabbitListenerContainerFactory 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 RabbitListenerEndpoint instance to register.factory - the RabbitListenerContainerFactory to use.public void registerEndpoint(RabbitListenerEndpoint endpoint)
RabbitListenerEndpoint using the default
RabbitListenerContainerFactory to create the underlying container.endpoint - the RabbitListenerEndpoint instance to register.setContainerFactory(RabbitListenerContainerFactory),
registerEndpoint(RabbitListenerEndpoint, RabbitListenerContainerFactory)