Giter VIP home page Giter VIP logo

kafka's Introduction

##项目说明:

使用pykafka实现基于kafka的Http rpc。    

consumer采用balanced consumer group实现,可以启动任意多实例,基于ZK协调负载均衡和容灾。

producer可以是任意语言,只需按照协议向kafka投递message,consumer会从message中获取url和body,并向url发起HTTP POST请求,收到200返回码认为请求成功。

##环境:

  • kafka 0.8.2(基于topic实现的consumer group offset)
  • pip install pykafka
  • python 2.7.10

##代码说明:

  • producer.py:命令行测试工具,发送一条消息
  • consumer.py:负载均衡的consumer,可以启动多个实例,partition将自动在多进程间负载均衡,可通过Http通知其重置offset到队列末尾(运维常见场景)
  • offset_check.py:检查topic的各partition的offset总量和消费的offset量
  • offset_reset.py:根据consumer在zk上注册的http地址,逐个调用/reset-offset请求将consume offset调整至队列末尾

kafka's People

Contributors

owenliang avatar

Watchers

James Cloos 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.