The Firehose service can take a max batch size of 500. While created the example the need for finer grained configuration was necessary. |
||
|---|---|---|
| emitter | ||
| examples | ||
| .gitignore | ||
| awsbackoff.go | ||
| awsbackoff_test.go.bk | ||
| buffer.go | ||
| buffer_test.go | ||
| checkpoint.go | ||
| checkpoint_test.go | ||
| consumer.go | ||
| consumer_test.go | ||
| CONTRIBUTING.md | ||
| handler.go | ||
| logger.go | ||
| MIT-LICENSE | ||
| README.md | ||
Golang Kinesis Connectors
Kinesis connector applications written in Go
With the new release of Kinesis Firehose I'd recommend using the Lambda Streams to Firehose project for loading data directly into 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, setting checkpoints, respecting ratelimits, and recovering from network errors.
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()
// create new consumer
c := connector.NewConsumer(*app, *stream)
// override default values
c.Set("maxBatchCount", 200)
c.Set("pollInterval", "3s")
// start consuming records from the queues
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.
