Class MessageTimerMonitor

java.lang.Object
org.axonframework.micrometer.MessageTimerMonitor
All Implemented Interfaces:
MessageMonitor<Message<?>>

public class MessageTimerMonitor extends Object implements MessageMonitor<Message<?>>
A MessageMonitor which introduces a Timer for the overall timer of all Messages being ingested, as well as a success, failure and ignored Timer.
Since:
4.1
Author:
Marijn van Zelst, Ivan Dugalic
  • Constructor Details

  • Method Details

    • builder

      public static MessageTimerMonitor.Builder builder()
      Instantiate a Builder to be able to create a MessageTimerMonitor.

      The Clock is defaulted to a Clock.SYSTEM, the tagsBuilder to a Function returning Tags.empty() and the timerCustomization to a no-op. The meterNamePrefix and MeterRegistry are hard requirements and as such should be provided.

      Returns:
      a Builder to be able to create a MessageTimerMonitor
    • buildMonitor

      @Deprecated public static MessageTimerMonitor buildMonitor(String meterNamePrefix, io.micrometer.core.instrument.MeterRegistry meterRegistry)
      Deprecated.
      in favor of using the builder()
      Creates a message timer monitor.
      Parameters:
      meterNamePrefix - the prefix for the meter name that will be created in the given meterRegistry
      meterRegistry - the meter registry used to create and register the meters
      Returns:
      the message timer monitor
    • buildMonitor

      @Deprecated public static MessageTimerMonitor buildMonitor(String meterNamePrefix, io.micrometer.core.instrument.MeterRegistry meterRegistry, Function<Message<?>,Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder)
      Deprecated.
      in favor of using the builder()
      Creates a message timer monitor.
      Parameters:
      meterNamePrefix - the prefix for the meter name that will be created in the given meterRegistry
      meterRegistry - the meter registry used to create and register the meters
      tagsBuilder - the function used to construct the list of micrometer Tag, based on the ingested message
      Returns:
      the message timer monitor
    • buildMonitor

      @Deprecated public static MessageTimerMonitor buildMonitor(String meterNamePrefix, io.micrometer.core.instrument.MeterRegistry meterRegistry, io.micrometer.core.instrument.Clock clock)
      Deprecated.
      in favor of using the builder()
      Creates a message timer monitor.
      Parameters:
      meterNamePrefix - the prefix for the meter name that will be created in the given meterRegistry
      meterRegistry - the meter registry used to create and register the meters
      clock - the clock used to measure the process time per message
      Returns:
      the message timer monitor
    • buildMonitor

      @Deprecated public static MessageTimerMonitor buildMonitor(String meterNamePrefix, io.micrometer.core.instrument.MeterRegistry meterRegistry, io.micrometer.core.instrument.Clock clock, Function<Message<?>,Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder)
      Deprecated.
      in favor of using the builder()
      Creates a message timer monitor.
      Parameters:
      meterNamePrefix - the prefix for the meter name that will be created in the given meterRegistry
      meterRegistry - the meter registry used to create and register the meters
      clock - the clock used to measure the process time per message
      tagsBuilder - the function used to construct the list of micrometer Tag, based on the ingested message
      Returns:
      the message timer monitor
    • onMessageIngested

      public MessageMonitor.MonitorCallback onMessageIngested(@Nonnull Message<?> message)
      Description copied from interface: MessageMonitor
      Takes a message and returns a callback that should be used to inform the message monitor about the result of processing the message
      Specified by:
      onMessageIngested in interface MessageMonitor<Message<?>>
      Parameters:
      message - the message to monitor
      Returns:
      the callback