Packages

t

net.manub.embeddedkafka.streams

EmbeddedKafkaStreams

trait EmbeddedKafkaStreams extends EmbeddedKafka with TestStreamsConfig

Helper trait for testing Kafka Streams. It creates an embedded Kafka Instance for each test case. Use runStreams to execute your streams.

Self Type
EmbeddedKafkaStreams with Suite
Linear Supertypes
TestStreamsConfig, EmbeddedKafka, EmbeddedKafkaSupport, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EmbeddedKafkaStreams
  2. TestStreamsConfig
  3. EmbeddedKafka
  4. EmbeddedKafkaSupport
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. def consumeFirstKeyedMessageFrom[K, V](topic: String, autoCommit: Boolean)(implicit config: EmbeddedKafkaConfig, keyDeserializer: Deserializer[K], valueDeserializer: Deserializer[V]): (K, V)
    Definition Classes
    EmbeddedKafkaSupport
    Annotations
    @throws( ... ) @throws( ... )
  7. def consumeFirstMessageFrom[V](topic: String, autoCommit: Boolean)(implicit config: EmbeddedKafkaConfig, valueDeserializer: Deserializer[V]): V
    Definition Classes
    EmbeddedKafkaSupport
    Annotations
    @throws( ... ) @throws( ... )
  8. def consumeFirstStringMessageFrom(topic: String, autoCommit: Boolean)(implicit config: EmbeddedKafkaConfig): String
    Definition Classes
    EmbeddedKafkaSupport
  9. def consumeNumberKeyedMessagesFrom[K, V](topic: String, number: Int, autoCommit: Boolean)(implicit config: EmbeddedKafkaConfig, keyDeserializer: Deserializer[K], valueDeserializer: Deserializer[V]): List[(K, V)]
    Definition Classes
    EmbeddedKafkaSupport
  10. def consumeNumberKeyedMessagesFromTopics[K, V](topics: Set[String], number: Int, autoCommit: Boolean, timeout: Duration, resetTimeoutOnEachMessage: Boolean)(implicit config: EmbeddedKafkaConfig, keyDeserializer: Deserializer[K], valueDeserializer: Deserializer[V]): Map[String, List[(K, V)]]
    Definition Classes
    EmbeddedKafkaSupport
  11. def consumeNumberMessagesFrom[V](topic: String, number: Int, autoCommit: Boolean)(implicit config: EmbeddedKafkaConfig, valueDeserializer: Deserializer[V]): List[V]
    Definition Classes
    EmbeddedKafkaSupport
  12. def consumeNumberMessagesFromTopics[V](topics: Set[String], number: Int, autoCommit: Boolean, timeout: Duration, resetTimeoutOnEachMessage: Boolean)(implicit config: EmbeddedKafkaConfig, valueDeserializer: Deserializer[V]): Map[String, List[V]]
    Definition Classes
    EmbeddedKafkaSupport
  13. def consumeNumberStringMessagesFrom(topic: String, number: Int, autoCommit: Boolean)(implicit config: EmbeddedKafkaConfig): List[String]
    Definition Classes
    EmbeddedKafkaSupport
  14. def createCustomTopic(topic: String, topicConfig: Map[String, String], partitions: Int, replicationFactor: Int)(implicit config: EmbeddedKafkaConfig): Unit
    Definition Classes
    EmbeddedKafkaSupport
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  17. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. def kafkaConsumer[K, T](implicit config: EmbeddedKafkaConfig, keyDeserializer: Deserializer[K], deserializer: Deserializer[T]): KafkaConsumer[K, T]
    Definition Classes
    EmbeddedKafkaSupport
  22. def kafkaProducer[K, T](topic: String, key: K, message: T)(implicit config: EmbeddedKafkaConfig, keySerializer: Serializer[K], serializer: Serializer[T]): KafkaProducer[K, T]
    Definition Classes
    EmbeddedKafkaSupport
  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. def publishStringMessageToKafka(topic: String, message: String)(implicit config: EmbeddedKafkaConfig): Unit
    Definition Classes
    EmbeddedKafkaSupport
  27. def publishToKafka[K, T](topic: String, messages: Seq[(K, T)])(implicit config: EmbeddedKafkaConfig, keySerializer: Serializer[K], serializer: Serializer[T]): Unit
    Definition Classes
    EmbeddedKafkaSupport
    Annotations
    @throws( ... )
  28. def publishToKafka[K, T](topic: String, key: K, message: T)(implicit config: EmbeddedKafkaConfig, keySerializer: Serializer[K], serializer: Serializer[T]): Unit
    Definition Classes
    EmbeddedKafkaSupport
    Annotations
    @throws( ... )
  29. def publishToKafka[T](topic: String, message: T)(implicit config: EmbeddedKafkaConfig, serializer: Serializer[T]): Unit
    Definition Classes
    EmbeddedKafkaSupport
    Annotations
    @throws( ... )
  30. def runStreams(topicsToCreate: Seq[String], topology: Topology, extraConfig: Map[String, AnyRef] = Map.empty)(block: ⇒ Any)(implicit config: EmbeddedKafkaConfig): Any

    Execute Kafka streams and pass a block of code that can operate while the streams are active.

    Execute Kafka streams and pass a block of code that can operate while the streams are active. The code block can be used for publishing and consuming messages in Kafka. The block gets a pre-initialized kafka consumer that can be used implicitly for util methods such as consumeLazily(String).

    e.g.

    runStreams(Seq("inputTopic", "outputTopic", topology) {
     // here you can publish and consume messages and make assertions
     publishToKafka(in, Seq("one-string", "another-string"))
     consumeFirstStringMessageFrom(in) should be ("one-string")
    }
    topicsToCreate

    the topics that should be created in Kafka before launching the streams.

    topology

    the streams topology that will be used to instantiate the streams with a default configuration (all state directories are different and in temp folders)

    extraConfig

    additional KafkaStreams configuration (overwrite existing keys in default config)

    block

    the code block that will executed while the streams are active. Once the block has been executed the streams will be closed.

  31. def startKafka(config: EmbeddedKafkaConfig, kafkaLogDir: Directory): KafkaServer
    Definition Classes
    EmbeddedKafkaSupport
  32. def startZooKeeper(zooKeeperPort: Int, zkLogsDir: Directory): ServerCnxnFactory
    Definition Classes
    EmbeddedKafkaSupport
  33. def streamConfig(streamName: String, extraConfig: Map[String, AnyRef] = Map.empty)(implicit kafkaConfig: EmbeddedKafkaConfig): StreamsConfig

    Create a test stream config for a given stream.

    Create a test stream config for a given stream.

    streamName

    the name of the stream. It will be used as the Application ID

    extraConfig

    any additional configuration. If the keys are already defined in the default they will be overwritten with this

    kafkaConfig

    the Kafka test configuration

    returns

    the Streams configuration

    Definition Classes
    TestStreamsConfig
  34. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  35. def toString(): String
    Definition Classes
    AnyRef → Any
  36. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  39. def withRunningKafka[T](body: ⇒ T)(implicit config: EmbeddedKafkaConfig): T
    Definition Classes
    EmbeddedKafkaSupport
  40. def withRunningKafkaOnFoundPort[T](config: EmbeddedKafkaConfig)(body: (EmbeddedKafkaConfig) ⇒ T): T
    Definition Classes
    EmbeddedKafkaSupport
  41. val zkConnectionTimeoutMs: Int
    Definition Classes
    EmbeddedKafkaSupport
  42. val zkSecurityEnabled: Boolean
    Definition Classes
    EmbeddedKafkaSupport
  43. val zkSessionTimeoutMs: Int
    Definition Classes
    EmbeddedKafkaSupport

Inherited from TestStreamsConfig

Inherited from EmbeddedKafka

Inherited from EmbeddedKafkaSupport

Inherited from AnyRef

Inherited from Any

Ungrouped