Apache Kafka
http://kafka.apache.org/

Kafka,很容易就联想到《海边的卡夫卡》,文艺程度和Casablanca有得一拼。Kafka是一个分布式消息系统,

Apache Kafka:下一代分布式消息系统
http://www.infoq.com/cn/articles/apache-kafka

基本概念:
    - Topic 主题,表示消息的分类
    - Producer 消息的生存者
    - Consumer 消息的消费者
    - Broker 消息代理

Kafka剖析(一):Kafka背景及架构介绍
http://www.infoq.com/cn/articles/kafka-analysis-part-1/

c++来使用Kafka最常用的库是librdkafka

edenhill/librdkafka: The Apache Kafka C/C++ library
https://github.com/edenhill/librdkafka

c++作为Consumer的例子:
0、member
    - RdKafka::Consumer* _consumer;
    - RdKafka::Topic* _topic;
1、set kafka compression
    - RdKafka::Conf *conf = RdKafka::Conf::create(RdKafka::Conf::CONF_GLOBAL);
    - string compression = config.get_string(xxx::KAFKA_COMPRESSION);
    - conf->set("compression.codec", compression, errstr)
2、set offset config
    - RdKafka::Conf *tconf = RdKafka::Conf::create(RdKafka::Conf::CONF_TOPIC);
    - tconf->set("auto.commit.enable", ...)、auto.commit.interval.ms、offset.store.method
3、set kafka broker
    - conf->set("metadata.broker.list", broker, errstr)
4、create consumer
    - _consumer = RdKafka::Consumer::create(conf, errstr);
    - _topic = RdKafka::Topic::create(_consumer, topic_str, tconf, errstr);
    - _consumer->start(_topic, _partition, start_offset);
5、consume thread
    - RdKafka::Message *msg = _consumer->consume(_topic, _partition, 1000);
    - _msg_consumer(msg, NULL);
    - delete msg;
    - _consumer->poll(0);

后端程序员之路 36、Apache Kafka的更多相关文章

  1. 后端程序员之路 7、Zookeeper

    Zookeeper是hadoop的一个子项目,提供分布式应用程序协调服务. Apache ZooKeeper - Homehttps://zookeeper.apache.org/ zookeeper ...

  2. 后端程序员之路 59、go uiprogress

    gosuri/uiprogress: A go library to render progress bars in terminal applicationshttps://github.com/g ...

  3. 后端程序员之路 43、Redis list

    Redis数据类型之LIST类型 - Web程序猿 - 博客频道 - CSDN.NEThttp://blog.csdn.net/thinkercode/article/details/46565051 ...

  4. 后端程序员之路 29、Thrift

    Apache Thrift是Facebook实现的一个高效的.支持多种编程语言的远程服务调用(RPC)框架. Apache Thrift - Homehttp://thrift.apache.org/ ...

  5. 后端程序员之路 28、一个轻量级HTTP Server的实现

    提到http server,一般用到的都是Apache和nginx这样的成熟软件,但是,有的情况下,我们也许也会用一些非常轻量级的http server.http server的c++轻量级实现里,M ...

  6. 后端程序员之路 27、LogStash

    访谈与书评:<LogStash,使日志管理更简单>http://www.infoq.com/cn/articles/review-the-logstash-book/ [Logstash] ...

  7. 后端程序员之路 22、RESTful API

    理解RESTful架构 - 阮一峰的网络日志http://www.ruanyifeng.com/blog/2011/09/restful.html RESTful API 设计指南 - 阮一峰的网络日 ...

  8. 后端程序员之路 16、信息熵 、决策树、ID3

    信息论的熵 - guisu,程序人生. 逆水行舟,不进则退. - 博客频道 - CSDN.NEThttp://blog.csdn.net/hguisu/article/details/27305435 ...

  9. 后端程序员之路 4、一种monitor的做法

    record_t包含_sum._count._time_stamp._max._min最基础的一条记录,可以用来记录最大值.最小值.计数.总和metric_t含有RECORD_NUM(6)份recor ...

随机推荐

  1. dp practice 1

    https://codeforces.com/problemset/problem/553/A dp+组合数学 dp[i] 放前i种颜色的方法数 #include<bits/stdc++.h&g ...

  2. hdu3559 Frost Chain (概率dp+记忆化搜索)

    Problem Description In the unimaginable popular DotA game, the hero Lich has a wonderful skill: Fros ...

  3. 2020牛客暑期多校训练营(第八场) Kabaleo Lite

    传送门:Kabaleo Lite 题意 有n道菜,1≤n≤105,a[i]是每道菜可以赚的钱,−109≤ ai ≤109,b[i]是这道菜的个数,1≤bi≤105,你每次只能选从1开始连续的菜,然后问 ...

  4. HDOJ 1348 基本二维凸包问题

    这次写的凸包用的是Graham scan算法 就数据结构上只是简单地运用了一个栈 #include<stdio.h>#include<cmath>#include<alg ...

  5. poj1787 Charlie's Change

    Description Charlie is a driver of Advanced Cargo Movement, Ltd. Charlie drives a lot and so he ofte ...

  6. Pangolin 安装测试 Installation & Examination (Ubuntu 20.04)

    Pangolin 安装测试 Installation & Examination (Ubuntu 20.04) 如题所述,这是一个比较轻松的 Pangolin 安装配置方法,同样是基于 WSL ...

  7. .NET并发编程-数据结构不可变性

    本系列学习在.NET中的并发并行编程模式,实战技巧 内容目录 .NET不可变集合.NET并发集合函数式数据结构设计一个不可变类 作为程序员经常遇到产品上线后出现各种莫名其妙的问题,在我本地是好好的啊, ...

  8. 编程方式建视频——GitHub 热点速览 v.21.07

    作者:HelloGitHub-小鱼干 假期过半,大家过得如何,吃好喝好了吗?GitHub 很好!本周的 GitHub Trending 又上爆款项目--github1s 装完之后,一秒 GitHub ...

  9. 使用 Promise 实现请求自动重试

    使用 Promise 实现请求自动重试 "use strict"; /** * * @author xgqfrms * @license MIT * @copyright xgqf ...

  10. angular-2-tutorial-2017

    # angular-2-tutorial-2017https://www.sitepoint.com/understanding-component-architecture-angular/http ...