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
logger
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
void
destroy()
protected final ApplicationContext
protected final String
The 'id' attribute of the listener.protected MicrometerHolder
final void
setApplicationContext
(ApplicationContext applicationContext) void
setBeanName
(String beanName) void
setListenerId
(String listenerId) Set the listener id.void
setMicrometerEnabled
(boolean micrometerEnabled) Set to false to disable micrometer listener timers.void
setMicrometerTags
(Map<String, String> tags) Set additional tags for the Micrometer listener timers.void
setObservationEnabled
(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, setConnectionFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.amqp.rabbit.listener.MessageListenerContainer
afterPropertiesSet, getMessageListener, isConsumerBatchEnabled, lazyLoad, setAutoStartup, setQueueNames, setupMessageListener
Methods inherited from interface org.springframework.context.SmartLifecycle
getPhase, isAutoStartup, stop
-
Constructor Details
-
ObservableListenerContainer
public ObservableListenerContainer()
-
-
Method Details
-
getApplicationContext
-
setApplicationContext
- Specified by:
setApplicationContext
in 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:
setBeanName
in 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:MessageListenerContainer
Set the listener id.- Specified by:
setListenerId
in interfaceMessageListenerContainer
- Parameters:
listenerId
- the id.
-
destroy
public void destroy()- Specified by:
destroy
in interfaceDisposableBean
-