Class ObservableListenerContainer

java.lang.Object
org.springframework.amqp.rabbit.connection.RabbitAccessor
org.springframework.amqp.rabbit.listener.ObservableListenerContainer
All Implemented Interfaces:
MessageListenerContainer, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle
Direct Known Subclasses:
AbstractMessageListenerContainer

public abstract class ObservableListenerContainer extends RabbitAccessor implements MessageListenerContainer, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean
Since:
3.0.5
  • Constructor Details

    • ObservableListenerContainer

      public ObservableListenerContainer()
  • Method Details

    • getApplicationContext

      @Nullable protected final org.springframework.context.ApplicationContext getApplicationContext()
    • setApplicationContext

      public final void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
      Specified by:
      setApplicationContext in interface org.springframework.context.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 org.springframework.beans.factory.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 org.springframework.beans.factory.DisposableBean