Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bts/test_kafka

Ruby Kafka runner suitable for integration testing
https://github.com/bts/test_kafka

Last synced: 27 days ago
JSON representation

Ruby Kafka runner suitable for integration testing

Awesome Lists containing this project

README

        

# TestKafka

Minimal Kafka 0.8 runner suitable for integration testing.

Adapted from the excellent [poseidon](https://github.com/bpot/poseidon)'s integration tests.

## Installation

Add TestKafka to your application's Gemfile:

```ruby
gem 'test_kafka', '~> 0.1.1'
```

and bundle:

$ bundle

## Usage

```ruby
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