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
  • Constructor Details

    • ObservableListenerContainer

      public ObservableListenerContainer()
  • Method Details

    • getApplicationContext

      @Nullable protected final ApplicationContext getApplicationContext()
    • setApplicationContext

      public final void setApplicationContext(ApplicationContext applicationContext)
      Specified by:
      setApplicationContext in interface ApplicationContextAware
    • getMicrometerHolder

      protected MicrometerHolder getMicrometerHolder()
    • setMicrometerTags

      public void setMicrometerTags(Map<String,String> tags)
      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 if setObservationEnabled(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 by setMicrometerEnabled(boolean).
      Parameters:
      observationEnabled - true to enable.
      Since:
      3.0
      See Also:
    • checkMicrometer

      protected void checkMicrometer()
    • checkObservation

      protected void checkObservation()
    • setBeanName

      public void setBeanName(String beanName)
      Specified by:
      setBeanName in interface BeanNameAware
    • getBeanName

      @Nullable protected final String getBeanName()
      Returns:
      The bean name that this listener container has been assigned in its containing bean factory, if any.
    • getListenerId

      public String getListenerId()
      The 'id' attribute of the listener.
      Returns:
      the id (or the container bean name if no id set).
    • setListenerId

      public void setListenerId(String listenerId)
      Description copied from interface: MessageListenerContainer
      Set the listener id.
      Specified by:
      setListenerId in interface MessageListenerContainer
      Parameters:
      listenerId - the id.
    • destroy

      public void destroy()
      Specified by:
      destroy in interface DisposableBean