test_kafka

Ruby Kafka runner suitable for integration testing

MIT License

Downloads
5.8K
Stars
2
Committers
1

TestKafka

Minimal Kafka 0.8 runner suitable for integration testing.

Adapted from the excellent poseidon's integration tests.

Installation

Add TestKafka to your application's Gemfile:

gem 'test_kafka', '~> 0.1.1'

and bundle:

$ bundle

Usage

require 'test_kafka'

cluster = TestKafka.start('/usr/local/kafka')
# or specify custom a temp directory and kafka/zk ports:
# cluster = TestKafka.start('/usr/local/kafka', '/tmp', 9092, 2181)

# ... interact with Kafka/ZK ...

cluster.with_interruption do
  # broker temporarily stopped in this block
end

# broker is back up

cluster.stop

Requirements

  • Kafka 0.8 or higher
Package Rankings
Top 34.55% on Rubygems.org