ConsumerOps
Trait for Consumer-related actions.
Attributes
- C
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
Members list
Value members
Concrete methods
Consumes the first message available in a given topic, deserializing it as
type (K, V)
.
Consumes the first message available in a given topic, deserializing it as
type (K, V)
.
Only the message that is returned is committed if autoCommit
is false
.
If autoCommit
is true
then all messages that were polled will be
committed.
Attributes
- autoCommit
if
false
, only the offset for the consumed message will be committed. iftrue
, the offset for the last polled message will be committed instead.- config
an implicit EmbeddedKafkaConfig
- keyDeserializer
an implicit
Deserializer
for the typeK
- timeout
the interval to wait for messages before throwing
TimeoutException
- topic
the topic to consume a message from
- valueDeserializer
an implicit
Deserializer
for the typeV
- Returns:
the first message consumed from the given topic, with a type
(K, V)
Consumes the first message available in a given topic, deserializing it as
type V
.
Consumes the first message available in a given topic, deserializing it as
type V
.
Only the message that is returned is committed if autoCommit
is false
.
If autoCommit
is true
then all messages that were polled will be
committed.
Attributes
- autoCommit
if
false
, only the offset for the consumed message will be committed. iftrue
, the offset for the last polled message will be committed instead.- config
an implicit EmbeddedKafkaConfig
- timeout
the interval to wait for messages before throwing
TimeoutException
- topic
the topic to consume a message from
- valueDeserializer
an implicit
Deserializer
for the typeV
- Returns:
the first message consumed from the given topic, with a type
V
Consumes the first n messages available in given topics, deserializes them
as type (K, V)
, and returns the n messages in a Map
from topic name to
List[(K, V)]
.
Consumes the first n messages available in given topics, deserializes them
as type (K, V)
, and returns the n messages in a Map
from topic name to
List[(K, V)]
.
Only the messages that are returned are committed if autoCommit
is
false
. If autoCommit
is true
then all messages that were polled will
be committed.
Attributes
- autoCommit
if
false
, only the offset for the consumed messages will be committed. iftrue
, the offset for the last polled message will be committed instead.- config
an implicit EmbeddedKafkaConfig
- keyDeserializer
an implicit
Deserializer
for the typeK
- number
the number of messages to consume in a batch
- resetTimeoutOnEachMessage
when
true
, throwTimeoutException
if we have a silent period (no incoming messages) for the timeout interval; whenfalse
, throwTimeoutException
after the timeout interval if we haven't received all of the expected messages- timeout
the interval to wait for messages before throwing
TimeoutException
- topics
the topics to consume messages from
- valueDeserializer
an implicit
Deserializer
for the typeV
- Returns:
the List of messages consumed from the given topics, each with a type
(K, V)
Consumes the first n messages available in given topics, deserializes them
as type V
, and returns the n messages in a Map
from topic name to
List[V]
.
Consumes the first n messages available in given topics, deserializes them
as type V
, and returns the n messages in a Map
from topic name to
List[V]
.
Only the messages that are returned are committed if autoCommit
is
false
. If autoCommit
is true
then all messages that were polled will
be committed.
Attributes
- autoCommit
if
false
, only the offset for the consumed messages will be committed. iftrue
, the offset for the last polled message will be committed instead.- config
an implicit EmbeddedKafkaConfig
- number
the number of messages to consume in a batch
- resetTimeoutOnEachMessage
when
true
, throwTimeoutException
if we have a silent period (no incoming messages) for the timeout interval; whenfalse
, throwTimeoutException
after the timeout interval if we haven't received all of the expected messages- timeout
the interval to wait for messages before throwing
TimeoutException
- topics
the topics to consume messages from
- valueDeserializer
an implicit
Deserializer
for the typeV
- Returns:
the List of messages consumed from the given topics, each with a type
V
Loaner pattern that allows running a code block with a newly created producer. The producer's lifecycle will be automatically handled and closed at the end of the given code block.
Loaner pattern that allows running a code block with a newly created producer. The producer's lifecycle will be automatically handled and closed at the end of the given code block.
Attributes
- body
the function to execute that returns
T
- config
an implicit EmbeddedKafkaConfig
- keyDeserializer
an implicit
Deserializer
for the typeK
- valueDeserializer
an implicit
Deserializer
for the typeV