Trait

net.manub.embeddedkafka.streams

EmbeddedKafkaStreams

Related Doc: package streams

Permalink

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def consumeFirstMessageFrom[T](topic: String, autoCommit: Boolean)(implicit config: EmbeddedKafkaConfig, deserializer: Deserializer[T]): T

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
    Annotations
    @throws( ... ) @throws( ... )
  7. def consumeFirstStringMessageFrom(topic: String, autoCommit: Boolean)(implicit config: EmbeddedKafkaConfig): String

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  8. def consumeNumberMessagesFrom[T](topic: String, number: Int, autoCommit: Boolean)(implicit config: EmbeddedKafkaConfig, deserializer: Deserializer[T]): List[T]

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  9. def consumeNumberStringMessagesFrom(topic: String, number: Int, autoCommit: Boolean)(implicit config: EmbeddedKafkaConfig): List[String]

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  10. def createCustomTopic(topic: String, topicConfig: Map[String, String], partitions: Int, replicationFactor: Int)(implicit config: EmbeddedKafkaConfig): Unit

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. def publishStringMessageToKafka(topic: String, message: String)(implicit config: EmbeddedKafkaConfig): Unit

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  21. def publishToKafka[K, T](topic: String, key: K, message: T)(implicit config: EmbeddedKafkaConfig, keySerializer: Serializer[K], serializer: Serializer[T]): Unit

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
    Annotations
    @throws( ... )
  22. def publishToKafka[T](topic: String, message: T)(implicit config: EmbeddedKafkaConfig, serializer: Serializer[T]): Unit

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
    Annotations
    @throws( ... )
  23. def runStreams(topicsToCreate: Seq[String], builder: TopologyBuilder)(block: ⇒ Any)(implicit config: EmbeddedKafkaConfig): Any

    Permalink

    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", streamBuilder) {
     // 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.

    builder

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

    block

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

  24. def startKafka(config: EmbeddedKafkaConfig, kafkaLogDir: Directory): KafkaServer

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  25. def startZooKeeper(zooKeeperPort: Int, zkLogsDir: Directory): ServerCnxnFactory

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  26. def streamConfig(streamName: String, extraConfig: Map[String, AnyRef] = Map.empty)(implicit kafkaConfig: EmbeddedKafkaConfig): StreamsConfig

    Permalink

    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
  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  28. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  29. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. def withRunningKafka(body: ⇒ Any)(implicit config: EmbeddedKafkaConfig): Any

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  33. val zkConnectionTimeoutMs: Int

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  34. val zkSecurityEnabled: Boolean

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  35. val zkSessionTimeoutMs: Int

    Permalink
    Definition Classes
    EmbeddedKafkaSupport

Inherited from TestStreamsConfig

Inherited from EmbeddedKafka

Inherited from EmbeddedKafkaSupport

Inherited from AnyRef

Inherited from Any

Ungrouped