Interface MessageMonitor<T extends Message>

All Known Implementing Classes:
CapacityMonitor, CapacityMonitor, EventProcessorLatencyMonitor, EventProcessorLatencyMonitor, MessageCountingMonitor, MessageCountingMonitor, MessageTimerMonitor, MessageTimerMonitor, MultiMessageMonitor, NoOpMessageMonitor, PayloadTypeMessageMonitorWrapper, RecordingMessageMonitor

public interface MessageMonitor<T extends Message>
Specifies a mechanism to monitor message processing. When a message is supplied to a message monitor it returns a callback which should be used to notify the message monitor of the result of the processing of the event.

For example, a message monitor can track various things like message processing times, failure and success rates and occurred exceptions. It also can gather information contained in messages headers like timestamps and tracers

Since:
3.0
Author:
Marijn van Zelst, Nakul Mishra
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    An interface to let the message processor inform the message monitor of the result of processing the message
  • Method Summary

    Modifier and Type
    Method
    Description
    Takes a message and returns a callback that should be used to inform the message monitor about the result of processing the message
    onMessagesIngested(Collection<? extends T> messages)
    Takes a collection of messages and returns a map containing events along with their callbacks
  • Method Details

    • onMessageIngested

      MessageMonitor.MonitorCallback onMessageIngested(@Nonnull T message)
      Takes a message and returns a callback that should be used to inform the message monitor about the result of processing the message
      Parameters:
      message - the message to monitor
      Returns:
      the callback
    • onMessagesIngested

      default Map<? super T,MessageMonitor.MonitorCallback> onMessagesIngested(@Nonnull Collection<? extends T> messages)
      Takes a collection of messages and returns a map containing events along with their callbacks
      Parameters:
      messages - to monitor
      Returns:
      map where key = event and value = the callback