Attributes
- Companion
- trait
- Graph
-
- Supertypes
-
trait RunningKafkaOpstrait EmbeddedKafkatrait KafkaOpstrait ProducerOps[EmbeddedKafkaConfig]trait ConsumerOps[EmbeddedKafkaConfig]trait AdminOps[EmbeddedKafkaConfig]class Objecttrait Matchableclass AnyShow all
- Self type
-
EmbeddedKafka.type
Members list
Value members
Concrete methods
Returns whether the in memory servers are running.
Returns whether the in memory servers are running.
Attributes
- Definition Classes
-
RunningServersOps
Starts in memory servers, using temporary directories for storing logs. The log directories will be cleaned after calling EmbeddedServer.stop()
method or on JVM exit, whichever happens earlier.
Starts in memory servers, using temporary directories for storing logs. The log directories will be cleaned after calling EmbeddedServer.stop()
method or on JVM exit, whichever happens earlier.
Value parameters
- config
-
an implicit EmbeddedKafkaConfig
Attributes
- Definition Classes
Inherited 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.
Value parameters
- 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
Attributes
- Returns
-
the first message consumed from the given topic, with a type
(K, V)
- Inherited from:
- ConsumerOps
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.
Value parameters
- 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
Attributes
- Returns
-
the first message consumed from the given topic, with a type
V
- Inherited from:
- ConsumerOps
Attributes
- Inherited from:
- ConsumerOps
Attributes
- Inherited from:
- ConsumerOps
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.
Value parameters
- 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
Attributes
- Returns
-
the List of messages consumed from the given topics, each with a type
(K, V)
- Inherited from:
- ConsumerOps
Attributes
- Inherited from:
- ConsumerOps
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.
Value parameters
- 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
Attributes
- Returns
-
the List of messages consumed from the given topics, each with a type
V
- Inherited from:
- ConsumerOps
Attributes
- Inherited from:
- ConsumerOps
Creates a topic with a custom configuration.
Creates a topic with a custom configuration.
Value parameters
- config
-
an implicit EmbeddedKafkaConfig
- partitions
-
number of partitions
- replicationFactor
-
replication factor
- topic
-
the topic name
- topicConfig
-
per topic configuration
Map
Attributes
- Inherited from:
- AdminOps
Either deletes or marks for deletion a list of topics.
Either deletes or marks for deletion a list of topics.
Value parameters
- config
-
an implicit EmbeddedKafkaConfig
- topics
-
the topic names
Attributes
- Inherited from:
- AdminOps
Describe the topics.
Describe the topics.
Value parameters
- config
-
an implicit EmbeddedKafkaConfig
- topics
-
the topic names to describe
Attributes
- Returns
-
the list of topic names
- Inherited from:
- AdminOps
Lists the topics available.
Lists the topics available.
Value parameters
- config
-
an implicit EmbeddedKafkaConfig
Attributes
- Returns
-
the list of topic names
- Inherited from:
- AdminOps
Publishes synchronously a message of type String
to the running Kafka broker.
Publishes synchronously a message of type String
to the running Kafka broker.
Value parameters
- config
-
an implicit EmbeddedKafkaConfig
- message
-
the message to publish
- topic
-
the topic to which publish the message (it will be auto-created)
Attributes
- Throws
-
KafkaUnavailableException
if unable to connect to Kafka
- Inherited from:
- ProducerOps
Publishes synchronously a batch of message to the running Kafka broker.
Publishes synchronously a batch of message to the running Kafka broker.
Value parameters
- config
-
an implicit EmbeddedKafkaConfig
- keySerializer
-
an implicit
Serializer
for the typeK
- messages
-
the keys and messages of type
(K, T)
to publish - serializer
-
an implicit
Serializer
for the typeT
- topic
-
the topic to which publish the message (it will be auto-created)
Attributes
- Throws
-
KafkaUnavailableException
if unable to connect to Kafka
- Inherited from:
- ProducerOps
Publishes synchronously a message to the running Kafka broker.
Publishes synchronously a message to the running Kafka broker.
Value parameters
- config
-
an implicit EmbeddedKafkaConfig
- key
-
the key of type
K
to publish - message
-
the message of type
T
to publish - serializer
-
an implicit
Serializer
for the typeT
- topic
-
the topic to which publish the message (it will be auto-created)
Attributes
- Throws
-
KafkaUnavailableException
if unable to connect to Kafka
- Inherited from:
- ProducerOps
Publishes synchronously a message to the running Kafka broker.
Publishes synchronously a message to the running Kafka broker.
Value parameters
- config
-
an implicit EmbeddedKafkaConfig
- producerRecord
-
the producerRecord of type
T
to publish - serializer
-
an implicit
Serializer
for the typeT
Attributes
- Throws
-
KafkaUnavailableException
if unable to connect to Kafka
- Inherited from:
- ProducerOps
Publishes synchronously a message to the running Kafka broker.
Publishes synchronously a message to the running Kafka broker.
Value parameters
- config
-
an implicit EmbeddedKafkaConfig
- message
-
the message of type
T
to publish - serializer
-
an implicit
Serializer
for the typeT
- topic
-
the topic to which publish the message (it will be auto-created)
Attributes
- Throws
-
KafkaUnavailableException
if unable to connect to Kafka
- Inherited from:
- ProducerOps
Starts a Kafka broker in memory, storing logs in a specific location.
Starts a Kafka broker in memory, storing logs in a specific location.
Value parameters
- config
-
an implicit EmbeddedKafkaConfig
- kafkaLogsDir
-
the path for the Kafka logs
Attributes
- Returns
-
an EmbeddedK server
- Inherited from:
- RunningKafkaOps
Stops a specific EmbeddedServer
instance, and deletes the log directory.
Stops a specific EmbeddedServer
instance, and deletes the log directory.
Value parameters
- server
-
the
EmbeddedServer
to be stopped.
Attributes
- Inherited from:
- RunningServersOps (hidden)
Stops all in memory servers and deletes the log directories.
Stops all in memory servers and deletes the log directories.
Attributes
- Inherited from:
- RunningServersOps (hidden)
Stops all in memory Kafka instances, preserving the logs directories.
Stops all in memory Kafka instances, preserving the logs directories.
Attributes
- Inherited from:
- RunningKafkaOps
Creates an AdminClient
, then executes the body passed as a parameter.
Creates an AdminClient
, then executes the body passed as a parameter.
Value parameters
- body
-
the function to execute
- config
-
an implicit EmbeddedKafkaConfig
Attributes
- Inherited from:
- AdminOps
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.
Value parameters
- 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
Attributes
- Inherited from:
- ConsumerOps
Loaner pattern that allows running a code block with a newly created consumer. The consumer'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 consumer. The consumer's lifecycle will be automatically handled and closed at the end of the given code block.
Value parameters
- body
-
the function to execute that returns
T
- config
-
an implicit EmbeddedKafkaConfig
- keySerializer
-
an implicit
Serializer
for the typeK
- valueSerializer
-
an implicit
Serializer
for the typeV
Attributes
- Inherited from:
- ProducerOps
Starts a Kafka broker and controller (and performs additional logic, if any), then executes the body passed as a parameter.
Starts a Kafka broker and controller (and performs additional logic, if any), then executes the body passed as a parameter.
Value parameters
- body
-
the function to execute
- config
-
an implicit EmbeddedKafkaConfig
Attributes
- Inherited from:
- EmbeddedKafkaSupport (hidden)
Starts a Kafka broker and controller (and performs additional logic, if any), then executes the body passed as a parameter. The actual ports of the servers will be detected and inserted into a copied version of the EmbeddedKafkaConfig that gets passed to body. This is useful if you set any port to 0
, which will listen on an arbitrary available port.
Starts a Kafka broker and controller (and performs additional logic, if any), then executes the body passed as a parameter. The actual ports of the servers will be detected and inserted into a copied version of the EmbeddedKafkaConfig that gets passed to body. This is useful if you set any port to 0
, which will listen on an arbitrary available port.
Value parameters
- body
-
the function to execute, given an EmbeddedKafkaConfig with the actual ports the servers are running on
- config
-
the user-defined EmbeddedKafkaConfig
Attributes
- Inherited from:
- EmbeddedKafkaSupport (hidden)
Inherited fields
Attributes
- Inherited from:
- AdminOps
Attributes
- Inherited from:
- KafkaOps
Attributes
- Inherited from:
- ConsumerOps
Attributes
- Inherited from:
- KafkaOps
Attributes
- Inherited from:
- ProducerOps
Attributes
- Inherited from:
- AdminOps
Attributes
- Inherited from:
- AdminOps
Attributes
- Inherited from:
- AdminOps
Attributes
- Inherited from:
- AdminOps
Attributes
- Inherited from:
- AdminOps
Attributes
- Inherited from:
- AdminOps