GithubHelp home page GithubHelp logo

wvanbergen / kazoo-go Goto Github PK

View Code? Open in Web Editor NEW
100.0 6.0 48.0 73 KB

Go library to access Kafka metadata in Zookeeper

Home Page: http://godoc.org/github.com/wvanbergen/kazoo-go

License: MIT License

Go 95.69% Makefile 4.31%

kazoo-go's Introduction

Kazoo

Kazoo is a library to interact with the Kafka metadata that lives in Zookeeper. It provides discovery of the cluster's brokers, topic metadata, and consumer groups.

API documentation can be found on godoc.org.

kazoo-go's People

Contributors

aybabtme avatar davidreynolds avatar epipho avatar f21 avatar guildencrantz avatar horkhe avatar jeremyschlatter avatar mblair avatar rrh avatar wvanbergen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kazoo-go's Issues

error when creating topic

We keep getting this error even though we have 1 kafka and 1 zookeeper running in my local machine. But once i restart kafka and zoo keeper it works again.
This happens after a while using our service for creating topics and ingesting data. Once this happens we have to restart the kafka and zoo keeper for the error to go away. Do you think this is because of the library.

error creating topic err="Replication factor must be between 1 and the number of brokers" topic=test_topic

i have this exception in zookeeper

EndOfStreamException: Unable to read additional data from client sessionid 0x15aecd5f32802d3, likely client has closed socket
at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:228)
at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208)
at java.lang.Thread.run(Thread.java:745)

kafka

Unable to reconnect to ZooKeeper service, session 0x15aecd5f32802ce has expired, closing socket connection (org.apache.zookeeper.ClientCnxn)
[2017-03-21 10:14:56,545] INFO zookeeper state changed (Expired) (org.I0Itec.zkclient.ZkClient)

how to get kafka logsize

i want to get kafka lag,i got offset,but i can not get kafka logsize,can anyone help me
kafka version is 0.82

Provide per-partition first and last offset

The offset shell allows to dump the oldest and newest offsets currently available in a partition:
https://cwiki.apache.org/confluence/display/KAFKA/System+Tools#SystemTools-GetOffsetShell
The same information is also available from the SimpleConsumer: https://apache.googlesource.com/kafka/+/trunk/core/src/main/scala/kafka/consumer/SimpleConsumer.scala#184

This information seems to be currently missing in the data returned by kazoo-go (you can ask for the current offset of a consumergroup, but not for the per-partition oldest/newset offsets).

ability to configure topic

Should be able to configure topic. Something like this:

func (t *Topic) SetConfig(map[string]string config) error {
  ...
}

Can I submit a patch for this?

BrokersW

I would find it extremely useful to have a BrokersW function to watch for broker changes.

Ignore nodes already existing properly when creating ConsumerGroup

In function kazoo.mkdirRecursive , it is trying to create the node and checking if the error is ErrNodeExists which is treated as no error.

The problem with this approach is that the intermediate nodes might exist but have restrictive ACL to not allow Create operation. In this case, we directly get unauthenticated error from zookeeper. For example, in my case:

/stream/kafka/dc is the Chroot. And this path already exists.
However, Create is not allowed for /, so trying to do create /stream directly returns unauthenticated error without any further evaluation. This fails the mkdirRecursive

Wouldn't it be better to explicitly check if the node exists and then try to create it if it doesn't? With this, if the node is there, there won't be any problem with authentication. If the node does not exist, and create is not allowed, then it will fail, like it should.

ResetOffsets doesn't delete correctly

Line 420 if consumergroup.go: You are attempting to delete version 0, which may not exist.

AFAICT (I'm no expert here), you first need to call Exists to return a stat struct for this node, extract the version number from that stat structure, and then delete that version, much as is done for the parent delete at line 425 just below that.

In addition, it would be nice if there were a path in JoinConsumerGroup (package kafka) that could optionally call ResetOffsets()

Tag it please

With the advent of dep and vgo proper semver versioning becomes a requirement. So could you please tag the release.

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.