Golang library for consuming Kinesis stream data
Find a file
2016-02-08 19:39:09 -08:00
emitter Move emitters to separate packages 2016-02-08 19:39:09 -08:00
examples Move emitters to separate packages 2016-02-08 19:39:09 -08:00
.gitignore Use go-kit Log interface 2015-05-25 22:40:40 -07:00
awsbackoff.go Use AWS SDK for S3 Emitter 2015-08-16 17:52:10 -07:00
awsbackoff_test.go.bk Refactor to use handler func 2016-02-06 17:50:17 -08:00
buffer.go Refactor to use handler func 2016-02-06 17:50:17 -08:00
buffer_test.go Refactor to use handler func 2016-02-06 17:50:17 -08:00
checkpoint.go Refactor to use handler func 2016-02-06 17:50:17 -08:00
checkpoint_test.go Refactor to use handler func 2016-02-06 17:50:17 -08:00
consumer.go Add Kinesis Firehose example 2016-02-08 13:21:54 -08:00
CONTRIBUTING.md Rename License file and add Contributing sections 2015-05-23 10:24:53 -07:00
handler.go Refactor to use handler func 2016-02-06 17:50:17 -08:00
logger.go Refactor to use handler func 2016-02-06 17:50:17 -08:00
MIT-LICENSE Rename License file and add Contributing sections 2015-05-23 10:24:53 -07:00
README.md Move emitters to separate packages 2016-02-08 19:39:09 -08:00

Golang Kinesis Connectors

Kinesis connector applications written in Go

With the release of Kinesis Firehose I'd recommend using Lambda Streams to Firehose for loading data to S3 and Redshift.

Inspired by the Amazon Kinesis Connector Library. This library is intended to be a lightweight wrapper around the Kinesis API to handle batching records, respecing ratelimits, setting checkpoints, and recovering gracefully from network errors.

golang_kinesis_connector

Overview

The consumer expects a handler func that will process a buffer of incoming records.

func main() {
  var(
    app = flag.String("app", "", "The app name")
    stream = flag.String("stream", "", "The stream name")
  )
  flag.Parse()

  c := connector.NewConsumer(*app, *stream)
  c.Start(connector.HandlerFunc(func(b connector.Buffer) {
    fmt.Println(b.GetRecords())
    // process the records
  }))

  select {}
}

Installation

Get the package source:

$ go get github.com/harlow/kinesis-connectors

Examples

Use the seed stream code to put sample data onto the stream.

Logging

Default logging is handled by go-kit package log. Applications can override the default loging behaviour by implementing the Logger interface.

connector.SetLogger(NewCustomLogger())

Contributing

Please see CONTRIBUTING.md for more information. Thank you, contributors!

License

Copyright (c) 2015 Harlow Ward. It is free software, and may be redistributed under the terms specified in the LICENSE file.