Class MessageCountingMonitor

java.lang.Object
org.axonframework.extension.metrics.micrometer.MessageCountingMonitor
All Implemented Interfaces:
MessageMonitor<Message>

public class MessageCountingMonitor extends Object implements MessageMonitor<Message>
Counts the number of ingested, successful, failed and processed messages
Since:
4.1
Author:
Marijn van Zelst, Ivan Dugalic
  • Method Details

    • buildMonitor

      public static MessageCountingMonitor buildMonitor(String meterNamePrefix, io.micrometer.core.instrument.MeterRegistry meterRegistry)
      Creates a message counting 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 counting monitor
    • buildMonitor

      public static MessageCountingMonitor buildMonitor(String meterNamePrefix, io.micrometer.core.instrument.MeterRegistry meterRegistry, Function<Message,Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder)
      Creates a message counting 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 counting 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