Class MessageCountingMonitor
java.lang.Object
org.axonframework.extension.metrics.micrometer.MessageCountingMonitor
- All Implemented Interfaces:
MessageMonitor<Message>
Counts the number of ingested, successful, failed and processed messages
- Since:
- 4.1
- Author:
- Marijn van Zelst, Ivan Dugalic
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.axonframework.messaging.monitoring.MessageMonitor
MessageMonitor.MonitorCallback -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageCountingMonitorbuildMonitor(String meterNamePrefix, io.micrometer.core.instrument.MeterRegistry meterRegistry) Creates a message counting monitorstatic MessageCountingMonitorbuildMonitor(String meterNamePrefix, io.micrometer.core.instrument.MeterRegistry meterRegistry, Function<Message, Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder) Creates a message counting monitoronMessageIngested(Message message) Takes a message and returns a callback that should be used to inform the message monitor about the result of processing the messageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.messaging.monitoring.MessageMonitor
onMessagesIngested
-
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 meterRegistrymeterRegistry- 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 meterRegistrymeterRegistry- The meter registry used to create and register the meterstagsBuilder- The function used to construct the list of micrometerTag, based on the ingested message- Returns:
- The message counting monitor
-
onMessageIngested
Description copied from interface:MessageMonitorTakes a message and returns a callback that should be used to inform the message monitor about the result of processing the message- Specified by:
onMessageIngestedin interfaceMessageMonitor<Message>- Parameters:
message- the message to monitor- Returns:
- the callback
-