public class MessageTimerMonitor extends Object implements MessageMonitor<Message<?>>
MessageMonitor
which introduces a Timer
for the overall timer of all Message
s being
ingested, as well as a success, failure and ignored Timer
.Modifier and Type | Class and Description |
---|---|
static class |
MessageTimerMonitor.Builder
Builder class to instantiate a
MessageTimerMonitor . |
MessageMonitor.MonitorCallback
Modifier | Constructor and Description |
---|---|
protected |
MessageTimerMonitor(MessageTimerMonitor.Builder builder)
Instantiate a
MessageTimerMonitor based on the fields contained in the MessageTimerMonitor.Builder . |
Modifier and Type | Method and Description |
---|---|
static MessageTimerMonitor.Builder |
builder()
Instantiate a Builder to be able to create a
MessageTimerMonitor . |
static MessageTimerMonitor |
buildMonitor(String meterNamePrefix,
io.micrometer.core.instrument.MeterRegistry meterRegistry)
Deprecated.
in favor of using the
builder() |
static MessageTimerMonitor |
buildMonitor(String meterNamePrefix,
io.micrometer.core.instrument.MeterRegistry meterRegistry,
io.micrometer.core.instrument.Clock clock)
Deprecated.
in favor of using the
builder() |
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() |
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() |
MessageMonitor.MonitorCallback |
onMessageIngested(Message<?> message)
Takes a message and returns a callback that should be used
to inform the message monitor about the result of processing the message
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onMessagesIngested
protected MessageTimerMonitor(MessageTimerMonitor.Builder builder)
MessageTimerMonitor
based on the fields contained in the MessageTimerMonitor.Builder
.
Will assert that the meterNamePrefix
and MeterRegistry
are not null
and will throw an
AxonConfigurationException
if this is the case.
builder
- the MessageTimerMonitor.Builder
used to instantiate a MessageTimerMonitor
instancepublic static MessageTimerMonitor.Builder builder()
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.
MessageTimerMonitor
@Deprecated public static MessageTimerMonitor buildMonitor(String meterNamePrefix, io.micrometer.core.instrument.MeterRegistry meterRegistry)
builder()
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@Deprecated public static MessageTimerMonitor buildMonitor(String meterNamePrefix, io.micrometer.core.instrument.MeterRegistry meterRegistry, Function<Message<?>,Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder)
builder()
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 micrometer Tag
, based on the ingested
message@Deprecated public static MessageTimerMonitor buildMonitor(String meterNamePrefix, io.micrometer.core.instrument.MeterRegistry meterRegistry, io.micrometer.core.instrument.Clock clock)
builder()
meterNamePrefix
- the prefix for the meter name that will be created in the given meterRegistrymeterRegistry
- the meter registry used to create and register the metersclock
- the clock used to measure the process time per message@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)
builder()
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 micrometer Tag
, based on the ingested
messageclock
- the clock used to measure the process time per messagepublic MessageMonitor.MonitorCallback onMessageIngested(Message<?> message)
MessageMonitor
onMessageIngested
in interface MessageMonitor<Message<?>>
message
- the message to monitorCopyright © 2010–2022. All rights reserved.