Voltar ao ranking

confluentinc/librdkafka

C

The Apache Kafka C/C++ library

kafkakafka-consumerapache-kafkahigh-performanceclibrdkafkakafka-producerc-plus-plusconsumer
Crescimento de estrelas
Estrelas
1k
Forks
3.2k
Crescimento semanal
Issues
309
05001k
set. de 2012abr. de 2017dez. de 2021jul. de 2026
README

librdkafka - the Apache Kafka® C/C++ client library

Copyright (c) 2012-2022, Magnus Edenhill. 2023 Confluent Inc..

https://github.com/confluentinc/librdkafka

librdkafka is a C library implementation of the Apache Kafka protocol, providing Producer, Consumer and Admin clients. It was designed with message delivery reliability and high performance in mind, current figures exceed 1 million msgs/second for the producer and 3 million msgs/second for the consumer.

librdkafka is licensed under the 2-clause BSD license.

KAFKA is a registered trademark of The Apache Software Foundation and has been licensed for use by librdkafka. librdkafka has no affiliation with and is not endorsed by The Apache Software Foundation.

Features

  • Full Exactly-Once-Semantics (EOS) support
  • High-level producer, including Idempotent and Transactional producers
  • High-level balanced KafkaConsumer (requires broker >= 0.9)
  • Share consumer / Queues for Kafka (KIP-932) — Preview, C API only (requires broker >= 4.2)
  • Simple (legacy) consumer
  • Admin client
  • Compression: snappy, gzip, lz4, zstd
  • SSL support
  • SASL (GSSAPI/Kerberos/SSPI, PLAIN, SCRAM, OAUTHBEARER) support
  • Full list of supported KIPs
  • Broker version support: >=0.8 (see Broker version compatibility)
  • Guaranteed API stability for C & C++ APIs (ABI safety guaranteed for C)
  • Statistics metrics
  • Debian package: librdkafka1 and librdkafka-dev in Debian and Ubuntu
  • RPM package: librdkafka and librdkafka-devel
  • Gentoo package: dev-libs/librdkafka
  • Portable: runs on Linux, MacOS X, Windows, Solaris, FreeBSD, AIX, ...

Documentation

NOTE: The master branch is actively developed, use latest release for production use.

Installation

Installing prebuilt packages

On Mac OSX, install librdkafka with homebrew:

$ brew install librdkafka

On Debian and Ubuntu, install librdkafka from the Confluent APT repositories, see instructions here and then install librdkafka:

$ apt install librdkafka-dev

On RedHat, CentOS, Fedora, install librdkafka from the Confluent YUM repositories, instructions here and then install librdkafka:

$ yum install librdkafka-devel

On Windows, reference librdkafka.redist NuGet package in your Visual Studio project.

For other platforms, follow the source building instructions below.

Installing librdkafka using vcpkg

You can download and install librdkafka using the vcpkg dependency manager:

# Install vcpkg if not already installed
$ git clone https://github.com/Microsoft/vcpkg.git
$ cd vcpkg
$ ./bootstrap-vcpkg.sh
$ ./vcpkg integrate install

# Install librdkafka
$ vcpkg install librdkafka

The librdkafka package in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

Build from source

Requirements

The GNU toolchain
GNU make
	pthreads
zlib-dev (optional, for gzip compression support)
libssl-dev (optional, for SSL and SASL SCRAM support)
libsasl2-dev (optional, for SASL GSSAPI support)
libzstd-dev (optional, for ZStd compression support)
libcurl-dev (optional, for SASL OAUTHBEARER OIDC support)

NOTE: Static linking of ZStd (requires zstd >= 1.2.1) in the producer enables encoding the original size in the compression frame header, which will speed up the consumer. Use STATIC_LIB_libzstd=/path/to/libzstd.a ./configure --enable-static to enable static ZStd linking. MacOSX example: STATIC_LIB_libzstd=$(brew ls -v zstd | grep libzstd.a$) ./configure --enable-static

Building

  ./configure
  # Or, to automatically install dependencies using the system's package manager:
  # ./configure --install-deps
  # Or, build dependencies from source:
  # ./configure --install-deps --source-deps-only

  make
  sudo make install

NOTE: See README.win32 for instructions how to build on Windows with Microsoft Visual Studio.

NOTE: See CMake instructions for experimental CMake build (unsupported).

Usage in code

See getting Started with Apache Kafka and C/C++ for a basic tutorial.

  1. Refer to the examples directory for code using:

    • Producers: basic producers, idempotent producers, transactional producers.
    • Consumers: basic consumers, reading batches of messages.
    • Share consumers (Queues for Kafka, KIP-932, Preview): see the share_consumer* examples.
    • Performance and latency testing tools.
  2. Refer to the examples GitHub repo for code connecting to a cloud streaming data service based on Apache Kafka

  3. Link your program with -lrdkafka (C) or -lrdkafka++ (C++).

Commercial support

Commercial support is available from Confluent Inc

Community support

Only the latest official release is supported for community members.

File bug reports and feature requests using GitHub Issues.

Questions and discussions are welcome on the Discussions forum, and on the Confluent Community slack #clients channel.

Language bindings

See Powered by librdkafka for an incomplete list of librdkafka users.

Repositórios relacionados
pathwaycom/pathway

Python ETL framework for stream processing, real-time analytics, LLM pipelines, and RAG.

PythonPyPIOtherbatch-processingkafka
pathway.com
62.6k1.7k
DataTalksClub/data-engineering-zoomcamp

Data Engineering Zoomcamp is a free 9-week course on building production-ready data pipelines. The next cohort starts in January 2026. Join the course here 👇🏼

Jupyter Notebookdata-engineeringkafka
airtable.com/appzbS8Pkg9PL254a/shr6oVXeQvSI5HuWD
43.9k8.6k
apache/kafka

Apache Kafka - A distributed event streaming platform

JavaMavenApache License 2.0scalakafka
kafka.apache.org
33.3k15.4k
yudaocode/SpringBoot-Labs

一个涵盖六个专栏:Spring Boot 2.X、Spring Cloud、Spring Cloud Alibaba、Dubbo、分布式消息队列、分布式事务的仓库。希望胖友小手一抖,右上角来个 Star,感恩 1024

JavaMavenspring-bootspring-cloud
20.1k6.2k
influxdata/telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.

GoGo ModulesMIT Licensetelegrafmonitoring
influxdata.com/telegraf
17.7k5.8k
heibaiying/BigData-Notes

大数据入门指南 :star:

JavaMavenhadoophdfs
16.9k4.3k
zhisheng17/flink-learning

flink learning blog. http://www.54tianzhisheng.cn/ 含 Flink 入门、概念、原理、实战、性能调优、源码解析等内容。涉及 Flink Connector、Metrics、Library、DataStream API、Table API & SQL 等内容的学习案例,还有 Flink 落地应用的大型项目案例(PVUV、日志存储、百亿数据实时去重、监控告警)分享。欢迎大家支持我的专栏《大数据实时计算引擎 Flink 实战与性能优化》

JavaMavenApache License 2.0flinkkafka
54tianzhisheng.cn/tags/Flink/
15.1k3.9k
aalansehaiyang/technology-talk

【大厂面试专栏】一份Java程序员需要的技术指南,这里有面试题、系统架构、职场锦囊、主流中间件等,让你成为更牛的自己!

javaspring
offercome.cn
14.7k3.8k
sogou/workflow

C++ Parallel Computing and Asynchronous Networking Framework

C++Apache License 2.0taskinghttp
14.4k2.6k
debezium/debezium

Change data capture for a variety of databases. Please log issues at https://github.com/debezium/dbz/issues.

JavaMavenApache License 2.0change-data-capturekafka-connect
debezium.io
12.9k3k
IBM/sarama

Sarama is a Go library for Apache Kafka.

GoGo ModulesMIT Licensekafkakafka-client
12.5k1.9k
redpanda-data/redpanda

Redpanda is a streaming data platform for developers. Kafka API compatible. 10x faster. No ZooKeeper. No JVM!

C++kafkacpp
redpanda.com
12.4k772