Consumes the first message available in a given topic, deserializing it as a String.
Consumes the first message available in a given topic, deserializing it as a String.
Only the messsage that is returned is committed if autoCommit is false. If autoCommit is true then all messages that were polled will be committed.
the topic to consume a message from
if false, only the offset for the consumed message will be commited. if true, the offset for the last polled message will be committed instead. Defaulted to false.
an implicit EmbeddedKafkaConfig
an implicit org.apache.kafka.common.serialization.Deserializer for the type T
the first message consumed from the given topic, with a type T
KafkaUnavailableException
if unable to connect to Kafka
TimeoutException
if unable to consume a message within 5 seconds
Consumes the first n messages available in a given topic, deserializing it as a String, and returns the n messages as a List.
Consumes the first n messages available in a given topic, deserializing it as a String, and returns the n messages as a List.
Only the messsages that are returned are committed if autoCommit is false. If autoCommit is true then all messages that were polled will be committed.
the topic to consume a message from
the number of messagese to consume in a batch
if false, only the offset for the consumed message will be commited. if true, the offset for the last polled message will be committed instead. Defaulted to false.
an implicit EmbeddedKafkaConfig
an implicit org.apache.kafka.common.serialization.Deserializer for the type T
the first message consumed from the given topic, with a type T
KafkaUnavailableException
if unable to connect to Kafka
TimeoutException
if unable to consume a message within 5 seconds
Creates a topic with a custom configuration
Creates a topic with a custom configuration
the topic name
per topic configuration Map
number of partitions Int
replication factor Int
an implicit EmbeddedKafkaConfig
Publishes synchronously a message of type String to the running Kafka broker.
Publishes synchronously a message of type String to the running Kafka broker.
the topic to which publish the message (it will be auto-created)
the String message to publish
an implicit EmbeddedKafkaConfig
KafkaUnavailableException
if unable to connect to Kafka
Publishes synchronously a message to the running Kafka broker.
Publishes synchronously a message to the running Kafka broker.
the topic to which publish the message (it will be auto-created)
the key of type K to publish
the message of type T to publish
an implicit EmbeddedKafkaConfig
an implicit Serializer for the type T
KafkaUnavailableException
if unable to connect to Kafka
Publishes synchronously a message to the running Kafka broker.
Publishes synchronously a message to the running Kafka broker.
the topic to which publish the message (it will be auto-created)
the message of type T to publish
an implicit EmbeddedKafkaConfig
an implicit Serializer for the type T
KafkaUnavailableException
if unable to connect to Kafka
Starts a ZooKeeper instance and a Kafka broker, then executes the body passed as a parameter.
Starts a ZooKeeper instance and a Kafka broker, then executes the body passed as a parameter.
the function to execute
an implicit EmbeddedKafkaConfig