Packages

o

zio.kafka.testkit

KafkaTestUtils

object KafkaTestUtils

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. KafkaTestUtils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val adminSettings: ZIO[Kafka, Nothing, AdminClientSettings]

    Makes AdminClientSettings for use in tests.

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  7. def consumeWithStrings(clientId: String, groupId: Option[String] = None, subscription: Subscription)(r: (ConsumerRecord[String, String]) => URIO[Any, Unit]): RIO[Kafka, Unit]

    Consumes a stream of ConsumerRecords for topics that have String keys and String values.

    Consumes a stream of ConsumerRecords for topics that have String keys and String values.

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

  8. def consumer(clientId: String, groupId: Option[String] = None, clientInstanceId: Option[String] = None, offsetRetrieval: OffsetRetrieval = OffsetRetrieval.Auto(AutoOffsetStrategy.Earliest), allowAutoCreateTopics: Boolean = true, diagnostics: Diagnostics = Diagnostics.NoOp, restartStreamOnRebalancing: Boolean = false, rebalanceSafeCommits: Boolean = false, maxRebalanceDuration: zio.Duration = 3.minutes, commitTimeout: zio.Duration = ConsumerSettings.defaultCommitTimeout, properties: Map[String, String] = Map.empty): ZLayer[Kafka, Throwable, Consumer]

    Consumer layer for use in tests.

    Consumer layer for use in tests.

    ℹ️ Instead of using a layer, consider using makeConsumer to directly get a consumer.

  9. def consumerSettings(clientId: String, groupId: Option[String] = None, clientInstanceId: Option[String] = None, allowAutoCreateTopics: Boolean = true, offsetRetrieval: OffsetRetrieval = OffsetRetrieval.Auto(AutoOffsetStrategy.Earliest), restartStreamOnRebalancing: Boolean = false, rebalanceSafeCommits: Boolean = false, maxRebalanceDuration: zio.Duration = 3.minutes, maxPollInterval: zio.Duration = 5.minutes, max.poll.records: Int = 100, commitTimeout: zio.Duration = ConsumerSettings.defaultCommitTimeout, properties: Map[String, String] = Map.empty): URIO[Kafka, ConsumerSettings]

    Makes ConsumerSettings for use in tests.

  10. def createCustomTopic(topic: String, partitionCount: Int = 1): ZIO[Kafka, Throwable, Unit]

    Create a topic.

  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  13. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. def makeAdminClient: ZIO[zio.&[Scope, Kafka], Throwable, AdminClient]

    Makes a AdminClient for use in tests.

  17. def makeConsumer(clientId: String, groupId: Option[String] = None, clientInstanceId: Option[String] = None, offsetRetrieval: OffsetRetrieval = OffsetRetrieval.Auto(AutoOffsetStrategy.Earliest), allowAutoCreateTopics: Boolean = true, diagnostics: Diagnostics = Diagnostics.NoOp, restartStreamOnRebalancing: Boolean = false, rebalanceSafeCommits: Boolean = false, maxRebalanceDuration: zio.Duration = 3.minutes, commitTimeout: zio.Duration = ConsumerSettings.defaultCommitTimeout, properties: Map[String, String] = Map.empty): ZIO[zio.&[Scope, Kafka], Throwable, Consumer]

    Makes a Consumer for use in tests.

  18. val makeProducer: ZIO[zio.&[Scope, Kafka], Throwable, Producer]

    Makes a Producer for use in tests.

  19. def makeSaslAdminClient(username: String = "admin", password: String = "admin-secret"): ZIO[zio.&[Scope, Sasl], Throwable, AdminClient]

    Makes a AdminClient for use in tests, using the SASL_PLAINTEXT security protocol.

  20. def makeSslAdminClient: ZIO[zio.&[Scope, Kafka], Throwable, AdminClient]

    Makes a AdminClient for use in tests, using the SSL security protocol.

  21. def makeTransactionalConsumer(clientId: String, groupId: String, clientInstanceId: Option[String] = None, offsetRetrieval: OffsetRetrieval = OffsetRetrieval.Auto(AutoOffsetStrategy.Earliest), allowAutoCreateTopics: Boolean = true, diagnostics: Diagnostics = Diagnostics.NoOp, restartStreamOnRebalancing: Boolean = false, rebalanceSafeCommits: Boolean = false, properties: Map[String, String] = Map.empty, rebalanceListener: RebalanceListener = RebalanceListener.noop): ZIO[zio.&[Scope, Kafka], Throwable, Consumer]

    Makes a transactional Consumer for use in tests.

  22. def makeTransactionalProducer(transactionalId: String): ZIO[zio.&[Scope, Kafka], Throwable, TransactionalProducer]

    Makes a TransactionalProducer for use in tests.

    Makes a TransactionalProducer for use in tests.

    Note: to run multiple tests in parallel, every test needs a different transactional id.

  23. def minimalConsumer(diagnostics: Diagnostics = Diagnostics.NoOp): ZLayer[ConsumerSettings, Throwable, Consumer]

    Consumer layer for use in tests, requires a ConsumerSettings layer.

    Consumer layer for use in tests, 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.

    ℹ️ Instead of using a layer, consider using KafkaTestUtils.makeConsumer to directly get a consumer.

  24. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  26. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  27. def produceMany(producer: Producer, topic: String, kvs: Iterable[(String, String)]): ZIO[Any, Throwable, Chunk[RecordMetadata]]

    Produce many messages to a topic.

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

    Produce many messages to the given partition of a topic.

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

    Produce a single message to a topic.

  30. val producer: ZLayer[Kafka, Throwable, Producer]

    Producer layer for use in tests.

    Producer layer for use in tests.

    ℹ️ Instead of using a layer, consider using KafkaTestUtils.makeProducer to directly get a producer.

  31. val producerSettings: ZIO[Kafka, Nothing, ProducerSettings]

    Makes ProducerSettings for use in tests.

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

    Makes AdminClientSettings for use in tests, using SASL_PLAINTEXT security protocol.

  33. def scheduledProduce[R](producer: Producer, topic: String, schedule: Schedule[R, Any, Long]): ZStream[R, Throwable, RecordMetadata]

    A stream that produces messages to a topic on a schedule for as long as it is running.

  34. val sslAdminSettings: ZIO[Kafka, Nothing, AdminClientSettings]

    Makes AdminClientSettings for use in tests, using SSL security protocol.

  35. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  36. def toString(): String
    Definition Classes
    AnyRef → Any
  37. def transactionalConsumer(clientId: String, groupId: String, clientInstanceId: Option[String] = None, offsetRetrieval: OffsetRetrieval = OffsetRetrieval.Auto(AutoOffsetStrategy.Earliest), allowAutoCreateTopics: Boolean = true, diagnostics: Diagnostics = Diagnostics.NoOp, restartStreamOnRebalancing: Boolean = false, rebalanceSafeCommits: Boolean = false, properties: Map[String, String] = Map.empty, rebalanceListener: RebalanceListener = RebalanceListener.noop): ZLayer[Kafka, Throwable, Consumer]

    A transactional Consumer layer for use in tests.

    A transactional Consumer layer for use in tests.

    ℹ️ Instead of using a layer, consider using KafkaTestUtils.makeTransactionalConsumer to directly get a consumer.

  38. def transactionalConsumerSettings(groupId: String, clientId: String, clientInstanceId: Option[String] = None, allowAutoCreateTopics: Boolean = true, offsetRetrieval: OffsetRetrieval = OffsetRetrieval.Auto(AutoOffsetStrategy.Earliest), restartStreamOnRebalancing: Boolean = false, rebalanceSafeCommits: Boolean = false, properties: Map[String, String] = Map.empty): URIO[Kafka, ConsumerSettings]

    Makes ConsumerSettings for a transactional consumer, use in tests.

  39. def transactionalProducer(transactionalId: String): ZLayer[Kafka, Throwable, TransactionalProducer]

    TransactionalProducer layer for use in tests.

    TransactionalProducer layer for use in tests.

    ℹ️ Instead of using a layer, consider using KafkaTestUtils.makeTransactionalProducer to directly get a producer.

  40. val transactionalProducer: ZLayer[Kafka, Throwable, TransactionalProducer]

    TransactionalProducer layer for use in tests.

    TransactionalProducer layer for use in tests.

    Note: to run multiple tests in parallel, you need to use different transactional ids via transactionalProducer(transactionalId).

    ℹ️ Instead of using a layer, consider using KafkaTestUtils.makeTransactionalProducer to directly get a producer.

  41. def transactionalProducerSettings(transactionalId: String): ZIO[Kafka, Nothing, TransactionalProducerSettings]

    Makes TransactionalProducerSettings for use in tests.

    Makes TransactionalProducerSettings for use in tests.

    Note: to run multiple tests in parallel, each producer needs a different transactional id.

  42. val transactionalProducerSettings: ZIO[Kafka, Nothing, TransactionalProducerSettings]

    Makes TransactionalProducerSettings for use in tests.

    Makes TransactionalProducerSettings for use in tests.

    Note: to run multiple tests in parallel, you need to use different transactional ids via transactionalProducerSettings(transactionalId).

  43. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  44. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  45. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

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

    Produce many messages to a topic.

    Produce many messages to a topic.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use method variant that accepts the Producer as parameter

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

    Produce many messages to the given partition of a topic.

    Produce many messages to the given partition of a topic.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use method variant that accepts the Producer as parameter

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

    Produce a single message to a topic.

    Produce a single message to a topic.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use method variant that accepts the Producer as parameter

  5. def scheduledProduce[R](topic: String, schedule: Schedule[R, Any, Long]): ZStream[R with Producer, Throwable, RecordMetadata]

    A stream that produces messages to a topic on a schedule for as long as it is running.

    A stream that produces messages to a topic on a schedule for as long as it is running.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use method variant that accepts the Producer as parameter

  6. def simpleConsumer(diagnostics: Diagnostics = Diagnostics.NoOp): ZLayer[ConsumerSettings, Throwable, Consumer]
    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.1) Use KafkaTestUtils.minimalConsumer instead

  7. def withAdmin[A](f: (AdminClient) => UIO[A]): ZIO[zio.&[Scope, Kafka], Throwable, A]

    Run f with an AdminClient.

    Run f with an AdminClient.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use KafkaTestUtils.makeAdminClient instead

  8. def withSaslAdmin[A](username: String = "admin", password: String = "admin-secret")(f: (AdminClient) => UIO[A]): ZIO[zio.&[Scope, Sasl], Throwable, A]

    Run f with an AdminClient, using the SASL_PLAINTEXT security protocol.

    Run f with an AdminClient, using the SASL_PLAINTEXT security protocol.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use KafkaTestUtils.makeSaslAdminClient instead

  9. def withSslAdmin[A](f: (AdminClient) => UIO[A]): ZIO[zio.&[Scope, Kafka], Throwable, A]

    Run f with an AdminClient, using the SSL security protocol.

    Run f with an AdminClient, using the SSL security protocol.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use KafkaTestUtils.makeSslAdminClient instead

Inherited from AnyRef

Inherited from Any

Ungrouped