Skip to content

Runs embedded, in-memory Apache Kafka instances. Helpful for integration testing.

License

Notifications You must be signed in to change notification settings

8eo/kafka-embedded

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kafka-embedded Build Status

Runs embedded, in-memory Apache Kafka and Apache ZooKeeper instances. Helpful for integration testing.

The code in this project was extracted from kafka-storm-starter to allow for easier reuse in other projects.


Table of Contents


Features

With this project you can run in-memory instances of:

Requirements

  • Java 7
  • Scala 2.10

Usage

Build dependencies

You must add two dependencies to use this project:

  1. The dependency for kafka-embedded itself, see below for details.
  2. The dependency for the specific Kafka version 0.8+ you want to use. (Kafka-embedded sets its Kafka dependency to "provided" so that users can pull in whichever Kafka version they need.)

Step 1: Adding a dependency for kafka-embedded

This project is published via Sonatype.

When using a snapshot:

// In build.sbt
resolvers ++= Seq("sonatype-snapshots" at "https://oss.sonatype.org/content/repositories/snapshots")

libraryDependencies ++= Seq("com.miguno" % "kafka-embedded_2.10" % "0.1.0-SNAPSHOT")

When using a release (note: no release has been published yet!):

// In build.sbt
libraryDependencies ++= Seq("com.miguno" % "kafka-embedded_2.10" % "0.1.0")

Step 2: Adding a dependency for Apache Kafka

You also need to pick a specific version of Kafka for your build.

Example:

// In build.sbt
libraryDependencies ++= Seq("org.apache.kafka" %% "kafka" % "0.8.1.1")

In many cases you want to exclude certain transitive dependencies of Kafka, e.g. Zookeeper. See build.sbt for an example list of such excludes for Kafka.

Examples

A full example of an integration test using in-memory instances of Kafka and ZooKeeper is available at KafkaZooKeeperClusterSpec.

Change log

See CHANGELOG.

Contributing to kafka-embedded

Code contributions, bug reports, feature requests etc. are all welcome.

If you are new to GitHub please read Contributing to a project for how to send patches and pull requests to kafka-embedded.

License

Copyright © 2014 Michael G. Noll

See LICENSE for licensing information.

About

Runs embedded, in-memory Apache Kafka instances. Helpful for integration testing.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scala 65.7%
  • Shell 34.3%