Class ObservableListenerContainer
java.lang.Object
org.springframework.amqp.rabbit.connection.RabbitAccessor
org.springframework.amqp.rabbit.listener.ObservableListenerContainer
- All Implemented Interfaces:
MessageListenerContainer,Aware,BeanNameAware,DisposableBean,InitializingBean,ApplicationContextAware,Lifecycle,Phased,SmartLifecycle
- Direct Known Subclasses:
AbstractMessageListenerContainer,StreamListenerContainer
public abstract class ObservableListenerContainer
extends RabbitAccessor
implements MessageListenerContainer, ApplicationContextAware, BeanNameAware, DisposableBean
- Since:
- 3.0.5
- Author:
- Gary Russell
-
Field Summary
Fields inherited from class org.springframework.amqp.rabbit.connection.RabbitAccessor
loggerFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidvoiddestroy()protected final ApplicationContextprotected final StringThe 'id' attribute of the listener.protected MicrometerHolderfinal voidsetApplicationContext(ApplicationContext applicationContext) voidsetBeanName(String beanName) voidsetListenerId(String listenerId) Set the listener id.voidsetMicrometerEnabled(boolean micrometerEnabled) Set to false to disable micrometer listener timers.voidsetMicrometerTags(Map<String, String> tags) Set additional tags for the Micrometer listener timers.voidsetObservationEnabled(boolean observationEnabled) Enable observation via micrometer; disables basic Micrometer timers enabled bysetMicrometerEnabled(boolean).Methods inherited from class org.springframework.amqp.rabbit.connection.RabbitAccessor
afterPropertiesSet, convertRabbitAccessException, createConnection, getChannel, getConnection, getConnectionFactory, getObservationRegistry, getTransactionalResourceHolder, isChannelTransacted, obtainObservationRegistry, setChannelTransacted, setConnectionFactoryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.amqp.rabbit.listener.MessageListenerContainer
afterPropertiesSet, getMessageListener, isConsumerBatchEnabled, lazyLoad, setAutoStartup, setQueueNames, setupMessageListenerMethods inherited from interface org.springframework.context.SmartLifecycle
getPhase, isAutoStartup, stop
-
Constructor Details
-
ObservableListenerContainer
public ObservableListenerContainer()
-
-
Method Details
-
getApplicationContext
-
setApplicationContext
- Specified by:
setApplicationContextin interfaceApplicationContextAware
-
getMicrometerHolder
-
setMicrometerTags
Set additional tags for the Micrometer listener timers.- Parameters:
tags- the tags.- Since:
- 2.2
-
setMicrometerEnabled
public void setMicrometerEnabled(boolean micrometerEnabled) Set to false to disable micrometer listener timers. When true, ignored ifsetObservationEnabled(boolean)is set to true.- Parameters:
micrometerEnabled- false to disable.- Since:
- 2.2
- See Also:
-
setObservationEnabled
public void setObservationEnabled(boolean observationEnabled) Enable observation via micrometer; disables basic Micrometer timers enabled bysetMicrometerEnabled(boolean).- Parameters:
observationEnabled- true to enable.- Since:
- 3.0
- See Also:
-
checkMicrometer
protected void checkMicrometer() -
checkObservation
protected void checkObservation() -
setBeanName
- Specified by:
setBeanNamein interfaceBeanNameAware
-
getBeanName
- Returns:
- The bean name that this listener container has been assigned in its containing bean factory, if any.
-
getListenerId
The 'id' attribute of the listener.- Returns:
- the id (or the container bean name if no id set).
-
setListenerId
Description copied from interface:MessageListenerContainerSet the listener id.- Specified by:
setListenerIdin interfaceMessageListenerContainer- Parameters:
listenerId- the id.
-
destroy
public void destroy()- Specified by:
destroyin interfaceDisposableBean
-