KafkaTestUtils

zio.kafka.testkit.KafkaTestUtils$

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def consumeWithStrings(clientId: String, groupId: Option[String], subscription: Subscription)(r: ConsumerRecord[String, String] => URIO[Any, Unit]): RIO[Kafka, Unit]

Utility function consume a stream of ConsumerRecords.

Utility function consume a stream of ConsumerRecords.

For each consumed record, the provided r function will be called.

Attributes

def consumer(clientId: String, groupId: Option[String], clientInstanceId: Option[String], offsetRetrieval: OffsetRetrieval, allowAutoCreateTopics: Boolean, diagnostics: Diagnostics, restartStreamOnRebalancing: Boolean, properties: Map[String, String]): ZLayer[Kafka, Throwable, Consumer]

Utility function to make a Consumer.

Utility function to make a Consumer.

Attributes

def consumerSettings(clientId: String, groupId: Option[String], clientInstanceId: Option[String], allowAutoCreateTopics: Boolean, offsetRetrieval: OffsetRetrieval, restartStreamOnRebalancing: Boolean, max.poll.records: Int, runloopTimeout: Duration, properties: Map[String, String]): URIO[Kafka, ConsumerSettings]

Utility function to make a Consumer settings set.

Utility function to make a Consumer settings set.

Attributes

def minimalConsumer(diagnostics: Diagnostics): ZLayer[ConsumerSettings, Throwable, Consumer]

Utility function to make a Consumer. It requires a ConsumerSettings layer.

Utility function to make a Consumer. It requires a ConsumerSettings layer.

"minimal" because, unlike the other functions returning a ZLayer[..., ..., Consumer] of this file, you need to provide the ConsumerSettings layer yourself.

Attributes

def produceMany(topic: String, partition: Int, kvs: Iterable[(String, String)]): ZIO[Producer, Throwable, Chunk[RecordMetadata]]

Utility function to produce many messages in give Partition of a Topic.

Utility function to produce many messages in give Partition of a Topic.

Attributes

def produceMany(topic: String, kvs: Iterable[(String, String)]): ZIO[Producer, Throwable, Chunk[RecordMetadata]]

Utility function to produce many messages in a Topic.

Utility function to produce many messages in a Topic.

Attributes

def produceOne(topic: String, key: String, message: String): ZIO[Producer, Throwable, RecordMetadata]

Utility function to produce a single message in a Topic.

Utility function to produce a single message in a Topic.

Attributes

def saslAdminSettings(username: String, password: String): ZIO[Sasl, Nothing, AdminClientSettings]

Utility function to make an AdminClient settings set using SASL_PLAINTEXT security protocol.

Utility function to make an AdminClient settings set using SASL_PLAINTEXT security protocol.

Attributes

def transactionalConsumer(clientId: String, groupId: String, clientInstanceId: Option[String], offsetRetrieval: OffsetRetrieval, allowAutoCreateTopics: Boolean, diagnostics: Diagnostics, restartStreamOnRebalancing: Boolean, properties: Map[String, String], rebalanceListener: RebalanceListener): ZLayer[Kafka, Throwable, Consumer]

Utility function to make a transactional Consumer.

Utility function to make a transactional Consumer.

Attributes

def transactionalConsumerSettings(groupId: String, clientId: String, clientInstanceId: Option[String], allowAutoCreateTopics: Boolean, offsetRetrieval: OffsetRetrieval, restartStreamOnRebalancing: Boolean, properties: Map[String, String]): URIO[Kafka, ConsumerSettings]

Utility function to make a transactional Consumer settings set.

Utility function to make a transactional Consumer settings set.

Attributes

def withAdmin[T](f: AdminClient => RIO[Kafka, T]): ZIO[Kafka, Throwable, T]

Utility function to execute something with an AdminClient instance configure with the default settings.

Utility function to execute something with an AdminClient instance configure with the default settings.

Attributes

def withSaslAdmin[T](username: String, password: String)(f: AdminClient => RIO[Sasl, T]): ZIO[Sasl, Throwable, T]

Utility function to execute something with an AdminClient instance configured to use the SASL_PLAINTEXT security protocol.

Utility function to execute something with an AdminClient instance configured to use the SASL_PLAINTEXT security protocol.

Attributes

def withSslAdmin[T](f: AdminClient => RIO[Kafka, T]): ZIO[Kafka, Throwable, T]

Utility function to execute something with an AdminClient instance configured to use the SSL security protocol.

Utility function to execute something with an AdminClient instance configured to use the SSL security protocol.

Attributes

Deprecated methods

def simpleConsumer(diagnostics: Diagnostics): ZLayer[ConsumerSettings, Throwable, Consumer]

Utility function to make a Consumer. It requires a ConsumerSettings layer.

Utility function to make a Consumer. It requires a ConsumerSettings layer.

Attributes

Deprecated
true

Concrete fields

Default AdminClient settings.

Default AdminClient settings.

Attributes

val producer: ZLayer[Kafka, Throwable, Producer]

Producer instance you can use in your tests. It uses the default Producer settings.

Producer instance you can use in your tests. It uses the default Producer settings.

Attributes

Default Producer settings you can use in your tests

Default Producer settings you can use in your tests

Attributes

Default AdminClient settings using SSL security protocol.

Default AdminClient settings using SSL security protocol.

Attributes

Transactional Producer instance you can use in your tests. It uses the default transactional Producer settings.

Transactional Producer instance you can use in your tests. It uses the default transactional Producer settings.

Attributes

Default transactional Producer settings you can use in your tests.

Default transactional Producer settings you can use in your tests.

Attributes