package api
Type Members
-
case class
FoundMatch(matchingReferenceMessage: MonitorObjectEnvelope) extends MonitorMatchFindResult with Product with Serializable
A result from a MonitorMatchFinder indicating that a reference message that should match was located.
A result from a MonitorMatchFinder indicating that a reference message that should match was located.
- matchingReferenceMessage
The message that should match the test message that was provided
-
case class
IgnoreMessage() extends MonitorMatchFindResult with Product with Serializable
A result from a MonitorMatchFinder indicating that, based on the information available, the provided test message should be ignored.
-
abstract
class
MonitorDeserializer extends AnyRef
An interface that instructs Detective how to deserialize messages from byte arrays into concrete Java objects.
An interface that instructs Detective how to deserialize messages from byte arrays into concrete Java objects. If you need to convert your objects into some custom structure for use in your implementation of Detective, you can extend this class and override the
deserializemethod to implement your deserialization algorithm.Instances of this class should have a zero-arg constructor.
-
sealed
trait
MonitorMatchFindResult extends AnyRef
The common parent for any kind of result from a MonitorMatchFinder
-
trait
MonitorMatchFinder extends AnyRef
In the Kafka Detective world, a
MonitorMatchFinderis the interface responsible for determining what mesages in the givenreferenceWindowshould be a match for the giventestMessage.In the Kafka Detective world, a
MonitorMatchFinderis the interface responsible for determining what mesages in the givenreferenceWindowshould be a match for the giventestMessage. The match finder provides afindmethod that can return any one of a few different results.Specifically, those results are:
- A FoundMatch instance if a message that should match is found in the
referenceWindow - A NoMatchFound instance if there should have been a message that would match, but there wasn't
- An IgnoreMessage instance if, based on the key, we chose not to try to find a match
Each of these situations will be reported out to the various configured MonitorReporters by Detective.
Instances of this class should have a zero-arg constructor.
- A FoundMatch instance if a message that should match is found in the
-
sealed
trait
MonitorMatchTestResult extends AnyRef
A type indicating the result of a match test.
-
trait
MonitorMatchTester extends AnyRef
In the Kafka Detective world, the
MonitorMatchTesteris responsible for determining whether or not a giventestMessageand a givenreferenceMessagematch.In the Kafka Detective world, the
MonitorMatchTesteris responsible for determining whether or not a giventestMessageand a givenreferenceMessagematch. At this point the assumption is that these messages should match because a MonitorMatchFinder already paired them up. However, the tester has the responsibility of determining if they actually do match.If you need to do expensive computation or have some level of complexity when determining equivalence, it is ideal to stick that logic inside a MonitorMatchTester, since that code is run many, many fewer times than code defined in a MonitorMatchFinder.
A tester can return one of two possible results:
- A SuccessfulMatchTest result, which indicates that the messages matched.
- An UnsuccessfulMatchTest result, which indicates they did not match, and contains information helpful for figuring out why.
There are a handful of default match testers provided in the
me.frmr.kafka.detective.matchtesterpackage of the Detective daemon.Instances of this class should have a zero-arg constructor.
-
case class
MonitorObjectEnvelope(messageOffset: Long, messagePartition: Int, messageTimestamp: Long, keyClass: Class[_], keyInstance: AnyRef, valueClass: Class[_], valueInstance: AnyRef) extends Product with Serializable
A wrapper around a message received from a Kafka topic.
A wrapper around a message received from a Kafka topic. This is the Kafka Detective equivalent of a standard
ConsumerRecordfrom the Kafka client APIs. It is intentionally typed a bit differently to facilitate use across JVM languages.- messageOffset
The offset of the message this envelope contains.
- messagePartition
The partition this message occured on.
- messageTimestamp
The timestamp associated with this message.
- keyClass
A
java.lang.Classdescribing what thekeyInstanceactually is.- keyInstance
The key for the message this envelope contains.
- valueClass
A
java.lang.Classdescribing what thevalueInstanceactually is.- valueInstance
The value of the message this envelope contains.
-
trait
MonitorReporter extends AnyRef
In the Kafka Detective world, a
MonitorReporteris responsible for reporting match events out to some other system.In the Kafka Detective world, a
MonitorReporteris responsible for reporting match events out to some other system. You could imagine that this is reporting out to... anything, really. It could be a metrics aggregator, it could be another Kafka topic, it could be anything!Instances of this class should have a constructor that takes two arguments:
monitorIdentifier: String- the string identifier for the monitor this reporter instance is forconfig: java.util.Map[String, Object]- Thereporter-configsblock from daemon configuration
-
trait
MonitorReporterTransformer extends AnyRef
In the Kafka Detective world, a
MonitorReporterTransformeris responsible for doing any kind of transformation required before writing the object out to some external source.In the Kafka Detective world, a
MonitorReporterTransformeris responsible for doing any kind of transformation required before writing the object out to some external source. Not all reporters may make use of a transformer, and they each have their own config keys for configuring the transformers.Instances of this class should have a zero-arg constructor.
-
case class
NoMatchFound() extends MonitorMatchFindResult with Product with Serializable
A result from a MonitorMatchFinder indicating that no reference message that should match the provided test message was found in the reference window.
-
case class
SuccessfulMatchTest() extends MonitorMatchTestResult with Product with Serializable
A match test result type indicating the match test was successful and that the provided
testMessageandreferenceMessageactually do match. -
case class
UnsuccessfulMatchTest(reason: String, testMessage: MonitorObjectEnvelope, referenceMessage: MonitorObjectEnvelope) extends MonitorMatchTestResult with Product with Serializable
A match test result type indicating the match test was unsuccessful and that the provided
testMessageandreferenceMessagedo not match.A match test result type indicating the match test was unsuccessful and that the provided
testMessageandreferenceMessagedo not match.- reason
A string reason indicating why the match failed
- testMessage
The test message from the comparison that failed
- referenceMessage
The reference message from the comparison that failed