Git Product home page Git Product logo

msgmid's Introduction

理解GC

Kafka学习笔记

Group的作用就在于让多个组织可以独立消费同一个topic。

Consumer Group (CG):这是kafka用来实现一个topic消息的广播(发给所有的consumer)和单播(发给任意一个consumer)的手段。一个topic可以有多个CG。topic的消息会复制(不是真的复制,是概念上的)到所有的CG,但每个partion只会把消息发给该CG中的一个consumer。如果需要实现广播,只要每个consumer有一个独立的CG就可以了。要实现单播只要所有的consumer在同一个CG。用CG还可以将consumer进行自由的分组而不需要多次发送消息到不同的topic;

kafka里面的group存在的意义和作用是什么呢?

比如你和老憨,从属于这家公司的两个team,业务需求都不一样,但是都需要这个topic,所以你们需要独立的消费,就是说同一条message给了那个组也得给我这个组。

但是在同一个组里,为了并行消费,可以设置多个机器(或者就是多个进程),每个机器的消费是不独立的,就是说给了你的话就不用再给我了,因为我们俩是一个组里面的同一个业务计算。

创建consumer,只能单独消费topic中的某一个partition; 创建ConsumerGroup,可以订阅多个topic,没有只能消费该topic单个partition的概念,topic更新消息,GC就能进行消费。

msgmid's People

Contributors

younglifestyle avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.