GithubHelp home page GithubHelp logo

poseidon's Introduction

Poseidon Build Status Code Climate

Poseidon is a Kafka client. Poseidon only supports the 0.8 API and above.

Until 1.0.0 this should be considered ALPHA software and not neccessarily production ready.

Usage

API Documentation

Installing a Kafka broker locally

Follow the instructions on the Kafka wiki to build Kafka 0.8 and get a test broker up and running.

Sending messages to Kafka

require 'poseidon'

producer = Poseidon::Producer.new(["localhost:9092"], "my_test_producer")

messages = []
messages << Poseidon::MessageToSend.new("topic1", "value1")
messages << Poseidon::MessageToSend.new("topic2", "value2")
producer.send_messages(messages)

More detailed Poseidon::Producer documentation.

Fetching messages from Kafka

require 'poseidon'

consumer = Poseidon::PartitionConsumer.new("my_test_consumer", "localhost", 9092,
                                            "topic1", 0, :earliest_offset)

loop do
  messages = consumer.fetch
  messages.each do |m|
    puts m.value
  end
end

More detailed Poseidon::PartitionConsumer documentation.

Using snappy compression

To use snappy compression in your producers or consumers, install the snappy gem or simply add gem 'snappy' to your project's Gemfile.

Semantic Versioning

This gem follows SemVer. In particular, the public API should not be considered stable and anything may change without warning until Version 1.0.0. Additionally, for the purposes of the versioning the public API is everything documented in the public API docs.

Requirements

  • Ruby 1.9.3 or higher (1.9.2 and below not supported!!!)
  • Kafka 0.8 or higher

Integration Tests

In order to run integration tests you must specify a KAFKA_PATH environment variable which points to a built Kafka installation. To build Kafka locally follow the instructions provided by the project.

# cd ~/src/poseidon/
# bundle
# KAFKA_PATH=~/src/kafka bundle exec rake spec:all # run all unit and integration specs

The poseidon test suite will take care of spinning up and down the broker(s) needed for the integration tests.

poseidon's People

Contributors

bpot avatar tamird avatar dim avatar zachmargolis avatar mnogu avatar sirupsen avatar v-a avatar aaronlasseigne avatar airhorns avatar hadronzoo avatar kazjote avatar rb2k avatar sclasen avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.