Object/Trait

net.manub.embeddedkafka

EmbeddedKafka

Related Docs: trait EmbeddedKafka | package embeddedkafka

Permalink

object EmbeddedKafka extends EmbeddedKafkaSupport

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EmbeddedKafka
  2. EmbeddedKafkaSupport
  3. AnyRef
  4. 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. object aKafkaProducer

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  5. final def asInstanceOf[T0]: T0

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

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

    Permalink

    Consumes the first message available in a given topic, deserializing it as a String.

    Consumes the first message available in a given topic, deserializing it as a String.

    Only the messsage that is returned is committed if autoCommit is false. If autoCommit is true then all messages that were polled will be committed.

    topic

    the topic to consume a message from

    autoCommit

    if false, only the offset for the consumed message will be commited. if true, the offset for the last polled message will be committed instead. Defaulted to false.

    config

    an implicit EmbeddedKafkaConfig

    deserializer

    an implicit org.apache.kafka.common.serialization.Deserializer for the type T

    returns

    the first message consumed from the given topic, with a type T

    Definition Classes
    EmbeddedKafkaSupport
    Annotations
    @throws( classOf[TimeoutException] ) @throws( classOf[KafkaUnavailableException] )
    Exceptions thrown

    KafkaUnavailableException if unable to connect to Kafka

    TimeoutException if unable to consume a message within 5 seconds

  8. def consumeFirstStringMessageFrom(topic: String, autoCommit: Boolean = false)(implicit config: EmbeddedKafkaConfig): String

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

    Permalink

    Consumes the first n messages available in a given topic, deserializing it as a String, and returns the n messages as a List.

    Consumes the first n messages available in a given topic, deserializing it as a String, and returns the n messages as a List.

    Only the messsages that are returned are committed if autoCommit is false. If autoCommit is true then all messages that were polled will be committed.

    topic

    the topic to consume a message from

    number

    the number of messagese to consume in a batch

    autoCommit

    if false, only the offset for the consumed message will be commited. if true, the offset for the last polled message will be committed instead. Defaulted to false.

    config

    an implicit EmbeddedKafkaConfig

    deserializer

    an implicit org.apache.kafka.common.serialization.Deserializer for the type T

    returns

    the first message consumed from the given topic, with a type T

    Definition Classes
    EmbeddedKafkaSupport
    Exceptions thrown

    KafkaUnavailableException if unable to connect to Kafka

    TimeoutException if unable to consume a message within 5 seconds

  10. def consumeNumberStringMessagesFrom(topic: String, number: Int, autoCommit: Boolean = false)(implicit config: EmbeddedKafkaConfig): List[String]

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

    Permalink

    Creates a topic with a custom configuration

    Creates a topic with a custom configuration

    topic

    the topic name

    topicConfig

    per topic configuration Map

    partitions

    number of partitions Int

    replicationFactor

    replication factor Int

    config

    an implicit EmbeddedKafkaConfig

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

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

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

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

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

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

    Permalink
    Definition Classes
    Any
  18. def isRunning: Boolean

    Permalink

    Returns whether the in memory Kafka and Zookeeper are running.

  19. final def ne(arg0: AnyRef): Boolean

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

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

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

    Permalink

    Publishes synchronously a message of type String to the running Kafka broker.

    Publishes synchronously a message of type String to the running Kafka broker.

    topic

    the topic to which publish the message (it will be auto-created)

    message

    the String message to publish

    config

    an implicit EmbeddedKafkaConfig

    Definition Classes
    EmbeddedKafkaSupport
    Exceptions thrown

    KafkaUnavailableException if unable to connect to Kafka

    See also

    EmbeddedKafka#publishToKafka

  23. def publishToKafka[K, T](topic: String, key: K, message: T)(implicit config: EmbeddedKafkaConfig, keySerializer: Serializer[K], serializer: Serializer[T]): Unit

    Permalink

    Publishes synchronously a message to the running Kafka broker.

    Publishes synchronously a message to the running Kafka broker.

    topic

    the topic to which publish the message (it will be auto-created)

    key

    the key of type K to publish

    message

    the message of type T to publish

    config

    an implicit EmbeddedKafkaConfig

    serializer

    an implicit Serializer for the type T

    Definition Classes
    EmbeddedKafkaSupport
    Annotations
    @throws( classOf[KafkaUnavailableException] )
    Exceptions thrown

    KafkaUnavailableException if unable to connect to Kafka

  24. def publishToKafka[T](topic: String, message: T)(implicit config: EmbeddedKafkaConfig, serializer: Serializer[T]): Unit

    Permalink

    Publishes synchronously a message to the running Kafka broker.

    Publishes synchronously a message to the running Kafka broker.

    topic

    the topic to which publish the message (it will be auto-created)

    message

    the message of type T to publish

    config

    an implicit EmbeddedKafkaConfig

    serializer

    an implicit Serializer for the type T

    Definition Classes
    EmbeddedKafkaSupport
    Annotations
    @throws( classOf[KafkaUnavailableException] )
    Exceptions thrown

    KafkaUnavailableException if unable to connect to Kafka

  25. def start()(implicit config: EmbeddedKafkaConfig): Unit

    Permalink

    Starts a ZooKeeper instance and a Kafka broker in memory, using temporary directories for storing logs.

    Starts a ZooKeeper instance and a Kafka broker in memory, using temporary directories for storing logs. The log directories will be cleaned after calling the stop() method or on JVM exit, whichever happens earlier.

    config

    an implicit EmbeddedKafkaConfig

  26. def startKafka(kafkaLogDir: Directory)(implicit config: EmbeddedKafkaConfig): Unit

    Permalink

    Starts a Kafka broker in memory, storing logs in a specific location.

    Starts a Kafka broker in memory, storing logs in a specific location.

    kafkaLogDir

    the path for the Kafka logs

    config

    an implicit EmbeddedKafkaConfig

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

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  28. def startZooKeeper(zkLogsDir: Directory)(implicit config: EmbeddedKafkaConfig): Unit

    Permalink

    Starts a Zookeeper instance in memory, storing logs in a specific location.

    Starts a Zookeeper instance in memory, storing logs in a specific location.

    zkLogsDir

    the path for the Zookeeper logs

    config

    an implicit EmbeddedKafkaConfig

  29. def startZooKeeper(zooKeeperPort: Int, zkLogsDir: Directory): ServerCnxnFactory

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  30. def stop(): Unit

    Permalink

    Stops the in memory ZooKeeper instance and Kafka broker, and deletes the log directories.

  31. def stopKafka(): Unit

    Permalink

    Stops the in memory Kafka instance, preserving the logs directory.

  32. def stopZooKeeper(): Unit

    Permalink

    Stops the in memory Zookeeper instance, preserving the logs directory.

  33. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. def withRunningKafka[T](body: ⇒ T)(implicit config: EmbeddedKafkaConfig): T

    Permalink

    Starts a ZooKeeper instance and a Kafka broker, then executes the body passed as a parameter.

    Starts a ZooKeeper instance and a Kafka broker, then executes the body passed as a parameter.

    body

    the function to execute

    config

    an implicit EmbeddedKafkaConfig

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

    Permalink

    Starts a ZooKeeper instance and a Kafka broker, then executes the body passed as a parameter.

    Starts a ZooKeeper instance and a Kafka broker, then executes the body passed as a parameter. The actual ZooKeeper and Kafka ports will be detected and inserted into a copied version of the EmbeddedKafkaConfig that gets passed to body. This is useful if you set either or both port to 0, which will listen on an arbitrary available port.

    config

    the user-defined EmbeddedKafkaConfig

    body

    the function to execute, given an EmbeddedKafkaConfig with the actual ports Kafka and ZooKeeper are running on

    Definition Classes
    EmbeddedKafkaSupport
  40. val zkConnectionTimeoutMs: Int

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  41. val zkSecurityEnabled: Boolean

    Permalink
    Definition Classes
    EmbeddedKafkaSupport
  42. val zkSessionTimeoutMs: Int

    Permalink
    Definition Classes
    EmbeddedKafkaSupport

Inherited from EmbeddedKafkaSupport

Inherited from AnyRef

Inherited from Any

Ungrouped