Defines methods for a mock kafka producer: allows for checking for test messages and provides a MkProducer instance. Keeps an internal offset for each topic so that messages can be consumed one by one with convenience methods.
Attributes
- Companion:
- object
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
Members list
Value members
Abstract methods
Returns the list of published messages for the given topic.
Returns the list of published messages for the given topic.
Attributes
- K
the key type
- V
the value type
- keyDeserializer
the key deserializer
- topic
the topic to get the history for
- valueDeserializer
the value deserializer
- Returns:
the list of published messages thus far
Returns the list of published messages for the given topic and key.
Returns the list of published messages for the given topic and key.
Attributes
- K
the key type
- V
the value type
- key
the key to get the history for
- keyDeserializer
the key deserializer
- topic
the topic to get the history for
- valueDeserializer
the value deserializer
- Returns:
the list of published messages thus far
Returns the next message for the given topic. Semantically blocks, with polling intervals and timeout specified with the patience implicit parameter
Returns the next message for the given topic. Semantically blocks, with polling intervals and timeout specified with the patience implicit parameter
Attributes
- keyDeserializer
the key deserializer
- patience
the patience to use for polling for the next message
- topic
the topic to get the next message for
- valueDeserializer
the value deserializer
- Throws:
- NoSuchElementException
if no message is available before the timeout
Returns the next message for the given topic and key. Semantically blocks, with polling intervals and timeout specified with the patience implicit parameter
Returns the next message for the given topic and key. Semantically blocks, with polling intervals and timeout specified with the patience implicit parameter
Attributes
- key
the key to get the next message for
- keyDeserializer
the key deserializer
- patience
the patience to use for polling for the next message
- topic
the topic to get the next message for
- valueDeserializer
the value deserializer
- Throws:
- NoSuchElementException
if no message is available before the timeout
Returns the next message for the given topic, if any. Increments the internal offset for the topic.
Returns the next message for the given topic, if any. Increments the internal offset for the topic.
Attributes
- K
the key type
- V
the value type
- keyDeserializer
the key deserializer
- topic
the topic to get the next message for
- valueDeserializer
the value deserializer
- Returns:
the next message for the given topic, if any
Returns the next message for the given topic and key, if any. Increments the internal offset for the topic.
Returns the next message for the given topic and key, if any. Increments the internal offset for the topic.
Attributes
- K
the key type
- V
the value type
- key
the key to get the next message for
- keyDeserializer
the key deserializer
- topic
the topic to get the next message for
- valueDeserializer
the value deserializer
- Returns:
the next message for the given topic and key, if any
Implicits
Implicits
MkProducer instance providing the mock producer. Including this instance in implicit scope where the kafka producer is created will feed it with the mock producer instance instead of the real one
MkProducer instance providing the mock producer. Including this instance in implicit scope where the kafka producer is created will feed it with the mock producer instance instead of the real one