Interface MessageListenerContainer
-
- All Superinterfaces:
org.springframework.beans.factory.InitializingBean,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
- All Known Implementing Classes:
AbstractMessageListenerContainer,DirectMessageListenerContainer,DirectReplyToMessageListenerContainer,SimpleMessageListenerContainer
public interface MessageListenerContainer extends org.springframework.context.SmartLifecycle, org.springframework.beans.factory.InitializingBeanInternal abstraction used by the framework representing a message listener container. Not meant to be implemented externally.- Since:
- 1.4
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidafterPropertiesSet()java.lang.ObjectgetMessageListener()Get the message listener.default booleanisConsumerBatchEnabled()Return true if this container is capable of (and configured to) create batches of consumed messages.default voidlazyLoad()Do not check for missing or mismatched queues during startup.voidsetAutoStartup(boolean autoStart)Set auto startup.voidsetListenerId(java.lang.String id)Set the listener id.voidsetQueueNames(java.lang.String... queues)Set the queue names.voidsetupMessageListener(org.springframework.amqp.core.MessageListener messageListener)Setup the message listener to use.
-
-
-
Method Detail
-
setupMessageListener
void setupMessageListener(org.springframework.amqp.core.MessageListener messageListener)
Setup the message listener to use. Throws anIllegalArgumentExceptionif that message listener type is not supported.- Parameters:
messageListener- theobjectto wrapped to theMessageListener.
-
lazyLoad
default void lazyLoad()
Do not check for missing or mismatched queues during startup. Used for lazily loaded message listener containers to avoid a deadlock when starting such containers. Applications lazily loading containers should verify the queue configuration before loading the container bean.- Since:
- 2.1.5
-
isConsumerBatchEnabled
default boolean isConsumerBatchEnabled()
Return true if this container is capable of (and configured to) create batches of consumed messages.- Returns:
- true if enabled.
- Since:
- 2.2.4
-
setQueueNames
void setQueueNames(java.lang.String... queues)
Set the queue names.- Parameters:
queues- the queue names.- Since:
- 2.4
-
setAutoStartup
void setAutoStartup(boolean autoStart)
Set auto startup.- Parameters:
autoStart- true to auto start.- Since:
- 2.4
-
getMessageListener
@Nullable java.lang.Object getMessageListener()
Get the message listener.- Returns:
- The message listener object.
- Since:
- 2.4
-
setListenerId
void setListenerId(java.lang.String id)
Set the listener id.- Parameters:
id- the id.- Since:
- 2.4
-
afterPropertiesSet
default void afterPropertiesSet()
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
-