https://github.com/remind101/kinesumer
Kinesis consumer library in Go
https://github.com/remind101/kinesumer
Last synced: 10 months ago
JSON representation
Kinesis consumer library in Go
- Host: GitHub
- URL: https://github.com/remind101/kinesumer
- Owner: remind101
- License: mit
- Created: 2015-07-14T20:48:57.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2016-12-09T07:22:44.000Z (over 9 years ago)
- Last Synced: 2025-06-18T00:43:31.995Z (about 1 year ago)
- Language: Go
- Size: 539 KB
- Stars: 10
- Watchers: 82
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Kinesumer
===
[](https://circleci.com/gh/remind101/kinesumer)
Kinesumer is a simple [Go](http://golang.org/) client library for Amazon AWS [Kinesis](http://aws.amazon.com/kinesis/). It aims to be a native Go alternative to Amazon's [KCL](https://github.com/awslabs/amazon-kinesis-client). Kinesumer includes a tool (called `kinesumer`) that lets you tail Kinesis streams and check the status of Kinesumer workers.
Features
---
* Automatically manages one consumer goroutine per shard.
* Handles shard splitting and merging properly.
* Provides a simple channel interface for incoming Kinesis records.
* Provides a tool for managing Kinesis streams:
* Tailing a stream
Using the package
---
Install
```bash
go get github.com/remind101/kinesumer
```
Example Program
```golang
package main
import (
"fmt"
"os"
"github.com/remind101/kinesumer"
)
func main() {
k, err := kinesumer.NewDefault(
"Stream",
)
if err != nil {
panic(err)
}
k.Begin()
defer k.End()
for i := 0; i < 100; i++ {
rec := <-k.Records()
fmt.Println(string(rec.Data()))
}
}
```
Using the tool
---
Install
```bash
go get -u github.com/remind101/kinesumer/cmd/kinesumer
```
To tail a stream make sure you have AWS credentials ready (either in ~/.aws or in env vars) and run:
```bash
kinesumer tail -s STREAM_NAME
```