Interface MessageListenerContainer
- All Superinterfaces:
InitializingBean
,Lifecycle
,Phased
,SmartLifecycle
- All Known Implementing Classes:
AbstractMessageListenerContainer
,DirectMessageListenerContainer
,DirectReplyToMessageListenerContainer
,ObservableListenerContainer
,SimpleMessageListenerContainer
,StreamListenerContainer
Internal abstraction used by the framework representing a message
listener container. Not meant to be implemented externally.
- Since:
- 1.4
- Author:
- Stephane Nicoll, Gary Russell
-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
Get the message listener.default boolean
Return true if this container is capable of (and configured to) create batches of consumed messages.default void
lazyLoad()
Do not check for missing or mismatched queues during startup.void
setAutoStartup
(boolean autoStart) Set auto startup.void
setListenerId
(String id) Set the listener id.void
setQueueNames
(String... queues) Set the queue names.void
setupMessageListener
(MessageListener messageListener) Setup the message listener to use.Methods inherited from interface org.springframework.context.SmartLifecycle
getPhase, isAutoStartup, stop
-
Method Details
-
setupMessageListener
Setup the message listener to use. Throws anIllegalArgumentException
if that message listener type is not supported.- Parameters:
messageListener
- theobject
to 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
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
Get the message listener.- Returns:
- The message listener object.
- Since:
- 2.4
-
setListenerId
Set the listener id.- Parameters:
id
- the id.- Since:
- 2.4
-
afterPropertiesSet
default void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceInitializingBean
-