Trait

net.manub.embeddedkafka.streams

EmbeddedKafkaStreamsAllInOne

Related Doc: package streams

Permalink

trait EmbeddedKafkaStreamsAllInOne extends EmbeddedKafkaStreams with Consumers

Convenience trait for testing Kafka Streams with ScalaTest. It exposes EmbeddedKafkaStreams.runStreams as well as Consumers api for easily creating and querying consumers in tests.

Self Type
EmbeddedKafkaStreamsAllInOne with Suite
See also

EmbeddedKafkaStreams

Consumers

Linear Supertypes
Consumers, EmbeddedKafkaStreams, TestStreamsConfig, EmbeddedKafka, EmbeddedKafkaSupport[EmbeddedKafkaConfig], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EmbeddedKafkaStreamsAllInOne
  2. Consumers
  3. EmbeddedKafkaStreams
  4. TestStreamsConfig
  5. EmbeddedKafka
  6. EmbeddedKafkaSupport
  7. AnyRef
  8. 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 baseConsumerConfig(implicit config: EmbeddedKafkaConfig): Map[String, AnyRef]

    Permalink
    Definition Classes
    EmbeddedKafka → EmbeddedKafkaSupport
  6. def baseProducerConfig(implicit config: EmbeddedKafkaConfig): Map[String, AnyRef]

    Permalink
    Definition Classes
    EmbeddedKafka → EmbeddedKafkaSupport
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def consumeFirstKeyedMessageFrom[K, V](topic: String, autoCommit: Boolean)(implicit config: EmbeddedKafkaConfig, keyDeserializer: Deserializer[K], valueDeserializer: Deserializer[V]): (K, V)

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
    Annotations
    @throws( ... ) @throws( ... )
  9. def consumeFirstMessageFrom[V](topic: String, autoCommit: Boolean)(implicit config: EmbeddedKafkaConfig, valueDeserializer: Deserializer[V]): V

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

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  11. def consumeNumberKeyedMessagesFrom[K, V](topic: String, number: Int, autoCommit: Boolean)(implicit config: EmbeddedKafkaConfig, keyDeserializer: Deserializer[K], valueDeserializer: Deserializer[V]): List[(K, V)]

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  12. 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)]]

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

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  14. def consumeNumberMessagesFromTopics[V](topics: Set[String], number: Int, autoCommit: Boolean, timeout: Duration, resetTimeoutOnEachMessage: Boolean)(implicit config: EmbeddedKafkaConfig, valueDeserializer: Deserializer[V]): Map[String, List[V]]

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    Any
  23. def kafkaConsumer[K, T](implicit config: EmbeddedKafkaConfig, keyDeserializer: Deserializer[K], deserializer: Deserializer[T]): KafkaConsumer[K, T]

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

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  25. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  26. def newConsumer[K, V]()(implicit arg0: Deserializer[K], arg1: Deserializer[V], config: EmbeddedKafkaConfig): KafkaConsumer[K, V]

    Permalink
    Definition Classes
    Consumers
  27. final def notify(): Unit

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

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

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

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
    Annotations
    @throws( ... )
  31. 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( ... )
  32. def publishToKafka[T](producerRecord: ProducerRecord[String, T])(implicit config: EmbeddedKafkaConfig, serializer: Serializer[T]): Unit

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

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
    Annotations
    @throws( ... )
  34. def runStreams[T](topicsToCreate: Seq[String], topology: Topology, extraConfig: Map[String, AnyRef] = Map.empty)(block: ⇒ T)(implicit config: EmbeddedKafkaConfig): T

    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.

    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.

    Definition Classes
    EmbeddedKafkaStreams
  35. def runStreamsWithStringConsumer(topicsToCreate: Seq[String], topology: Topology)(block: (KafkaConsumer[String, String]) ⇒ Any)(implicit config: EmbeddedKafkaConfig): Any

    Permalink

    Run Kafka Streams while offering a String-based consumer for easy testing of stream output.

    Run Kafka Streams while offering a String-based consumer for easy testing of stream output.

    topicsToCreate

    the topics that should be created. Usually these should be the topics that the Streams-under-test use for inputs and outputs. They need to be created before running the streams and this is automatically taken care of.

    topology

    the streams topology that will be instantiated

    block

    the block of testing code that will be executed by passing the simple String-based consumer.

    returns

    the result of the testing code

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

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

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  38. 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
  39. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. def withConsumer[K, V, T](block: (KafkaConsumer[K, V]) ⇒ T)(implicit arg0: Deserializer[K], arg1: Deserializer[V], config: EmbeddedKafkaConfig): T

    Permalink
    Definition Classes
    Consumers
  45. def withRunningKafka[T](body: ⇒ T)(implicit config: EmbeddedKafkaConfig): T

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  46. def withRunningKafkaOnFoundPort[T](config: EmbeddedKafkaConfig)(body: (EmbeddedKafkaConfig) ⇒ T): T

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  47. def withStringConsumer[T](block: (KafkaConsumer[String, String]) ⇒ T)(implicit config: EmbeddedKafkaConfig): T

    Permalink
    Definition Classes
    Consumers
  48. val zkConnectionTimeoutMs: Int

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  49. val zkSessionTimeoutMs: Int

    Permalink
    Definition Classes
    EmbeddedKafkaSupport

Inherited from Consumers

Inherited from EmbeddedKafkaStreams

Inherited from TestStreamsConfig

Inherited from EmbeddedKafka

Inherited from EmbeddedKafkaSupport[EmbeddedKafkaConfig]

Inherited from AnyRef

Inherited from Any

Ungrouped