Skip to content

Commit 75b5eae

Browse files
committed
Updated master branch to use Kafka 0.9.
1 parent 8534f97 commit 75b5eae

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# scalatest-embedded-kafka
2-
A library that provides an in-memory Kafka broker to run your ScalaTest specs against. It uses Kafka 0.8.2.2 and ZooKeeper 3.4.6.
2+
A library that provides an in-memory Kafka broker to run your ScalaTest specs against. It uses Kafka 0.9.0.0 and ZooKeeper 3.4.7.
3+
4+
**NOTE** the _master_ branch is now using Apache Kafka 0.9.x. The version supporting Kafka 0.8.x can be found [here](https://github.com/manub/scalatest-embedded-kafka/tree/kafka-0.8)
35

46
Inspired by https://github.com/chbatey/kafka-unit
57

68
## How to use
79

810
scalatest-embedded-kafka is available on Bintray and Maven Central, compiled for both Scala 2.10 and 2.11
911

10-
* In your `build.sbt` file add the following dependency: `"net.manub" %% "scalatest-embedded-kafka" % "0.4.1" % "test"`
12+
* In your `build.sbt` file add the following dependency: `"net.manub" %% "scalatest-embedded-kafka" % "0.4.1-kafka09" % "test"`
1113
* Have your `Spec` extend the `EmbeddedKafka` trait.
1214
* Enclose the code that needs a running instance of Kafka within the `withRunningKafka` closure.
1315

build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ lazy val commonSettings = Seq(
88
parallelExecution in Test := false,
99
libraryDependencies ++= Seq(
1010
"org.scalatest" %% "scalatest" % "2.2.5",
11-
"org.apache.kafka" %% "kafka" % "0.8.2.2",
12-
"org.apache.zookeeper" % "zookeeper" % "3.4.6",
11+
"org.apache.kafka" %% "kafka" % "0.9.0.0",
12+
"org.apache.zookeeper" % "zookeeper" % "3.4.7",
1313
"org.apache.avro" % "avro" % "1.7.7",
1414

1515
"com.typesafe.akka" %% "akka-actor" % "2.3.14" % Test,

src/main/scala/net/manub/embeddedkafka/EmbeddedKafka.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ sealed trait EmbeddedKafkaSupport {
104104

105105
val kafkaProducer = new KafkaProducer(Map(
106106
ProducerConfig.BOOTSTRAP_SERVERS_CONFIG -> s"localhost:${config.kafkaPort}",
107-
ProducerConfig.METADATA_FETCH_TIMEOUT_CONFIG -> 3000.toString,
107+
ProducerConfig.MAX_BLOCK_MS_CONFIG -> 10000.toString,
108108
ProducerConfig.RETRY_BACKOFF_MS_CONFIG -> 1000.toString
109109
), new StringSerializer, serializer)
110110

version.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version in ThisBuild := "0.5.0-SNAPSHOT"
1+
version in ThisBuild := "0.4.1-kafka09-SNAPSHOT"

0 commit comments

Comments
 (0)