README.md 5.1 KB
Newer Older
1 2
librdkafka - Apache Kafka C/C++ client library
==============================================
3

M
Magnus Edenhill 已提交
4
Copyright (c) 2012-2014, [Magnus Edenhill](http://www.edenhill.se/).
5 6 7

[https://github.com/edenhill/librdkafka](https://github.com/edenhill/librdkafka)

M
Magnus Edenhill 已提交
8
**librdkafka** is a C library implementation of the
9
[Apache Kafka](http://kafka.apache.org/) protocol, containing both
M
Magnus Edenhill 已提交
10 11 12
Producer and Consumer support. It was designed with message delivery reliability
and high performance in mind, current figures exceed 800000 msgs/second for
the producer and 3 million msgs/second for the consumer.
13

14
**librdkafka** is licensed under the 2-clause BSD license.
M
Magnus Edenhill 已提交
15

M
Magnus Edenhill 已提交
16 17 18
For an introduction to the performance and usage of librdkafka, see
[INTRODUCTION.md](https://github.com/edenhill/librdkafka/blob/master/INTRODUCTION.md)

M
Magnus Edenhill 已提交
19 20
See the [wiki](https://github.com/edenhill/librdkafka/wiki) for a FAQ.

M
Magnus Edenhill 已提交
21
**NOTE**: The `master` branch is actively developed, use latest release for production use.
M
Magnus Edenhill 已提交
22

M
Magnus Edenhill 已提交
23 24
[![Gitter chat](https://badges.gitter.im/edenhill/librdkafka.png)](https://gitter.im/edenhill/librdkafka)

25
**Apache Kafka 0.8 support:**
M
Magnus Edenhill 已提交
26

27 28
  * Branch: master
  * Producer: supported
M
Magnus Edenhill 已提交
29
  * Consumer: supported
30
  * Compression: snappy and gzip
M
Magnus Edenhill 已提交
31
  * Debian package: librdkafka1 and librdkafka-dev in Debian and Ubuntu
32
  * ZooKeeper: not supported
33 34
  * C API: Stable, ABI safe, not backwards compatible with 0.7
  * C++ API: Testing
M
Magnus Edenhill 已提交
35
  * Tests: Regression tests in `tests/` directory.
36
  * Statistics: JSON formatted, see `rd_kafka_conf_set_stats_cb` in `rdkafka.h`.
M
Magnus Edenhill 已提交
37
  * Status: Stable
M
Magnus Edenhill 已提交
38

39

40 41 42 43 44 45 46
**Apache Kafka 0.7 support:**

  * Branch: 0.7
  * Producer: supported
  * Consumer: supported
  * Compression: not supported
  * ZooKeeper: not supported
47
  * C API: backwards compatible with 0.6
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
  * Status: Stable


**Apache Kafka 0.6 support:**

  * Branch: 0.6
  * Producer: supported
  * Consumer: supported
  * Compression: not supported
  * ZooKeeper: not supported
  * Status: Testing




63 64 65 66 67
#Language bindings#

  * Haskell: [haskakafka](https://github.com/cosbynator/haskakafka)
  * Haskell: [haskell-kafka](https://github.com/yanatan16/haskell-kafka)
  * Node.js: [node-kafka](https://github.com/sutoiku/node-kafka)
M
Magnus Edenhill 已提交
68
  * Lua: [luardkafka](https://github.com/mistsv/luardkafka)
69
  * OCaml: [ocaml-kafka](https://github.com/didier-wenzek/ocaml-kafka)
70
  * PHP: [phpkafka](https://github.com/EVODelavega/phpkafka)
71
  * PHP: [php-rdkafka](https://github.com/arnaud-lb/php-rdkafka)
72 73 74
  * Python: [python-librdkafka](https://bitbucket.org/yungchin/python-librdkafka)
  * Python: [PyKafka](https://github.com/Parsely/pykafka)
  * Ruby: [Hermann](https://github.com/stancampbell3/Hermann)
75
  * Tcl: [KafkaTcl](https://github.com/flightaware/kafkatcl)
76

M
Magnus Edenhill 已提交
77
#Users of librdkafka#
78

M
Magnus Edenhill 已提交
79
  * [kafkacat](https://github.com/edenhill/kafkacat) - Apache Kafka swiss army knife
80 81 82
  * [Wikimedia's varnishkafka](https://github.com/wikimedia/varnishkafka) - Varnish cache web log producer
  * [Wikimedia's kafkatee](https://github.com/wikimedia/analytics-kafkatee) - Kafka multi consumer with filtering and fanout
  * [rsyslog](http://www.rsyslog.com)
83 84
  * [syslog-ng](http://syslog-ng.org)
  * [collectd](http://collectd.org)
M
Magnus Edenhill 已提交
85
  * [logkafka](https://github.com/Qihoo360/logkafka) - Collect logs and send to Kafka
86 87
  * [redBorder](http://www.redborder.net)
  * [Headweb](http://www.headweb.com/)
M
Magnus Edenhill 已提交
88
  * [Produban's log2kafka](https://github.com/Produban/log2kafka) - Web log producer
89
  * [fuse_kafka](https://github.com/yazgoo/fuse_kafka) - FUSE file system layer
90
  * [node-kafkacat](https://github.com/Rafflecopter/node-kafkacat)
M
Magnus Edenhill 已提交
91
  * [OVH](http://ovh.com) - [AntiDDOS](http://www.slideshare.net/hugfrance/hugfr-6-oct2014ovhantiddos)
92
  * [otto.de](http://otto.de)'s [trackdrd](https://github.com/otto-de/trackrdrd) - Varnish log reader
93
  * large unnamed financial institution
M
Magnus Edenhill 已提交
94
  * *Let [me](mailto:rdkafka@edenhill.se) know if you are using librdkafka*
95

M
Magnus Edenhill 已提交
96

97 98 99 100 101

# Usage

## Requirements
	The GNU toolchain
102
	GNU make
103 104 105 106 107 108 109
   	pthreads
	zlib

## Instructions

### Building

M
Magnus Edenhill 已提交
110 111
      ./configure
      make
M
Magnus Edenhill 已提交
112
      sudo make install
113 114


M
Magnus Edenhill 已提交
115 116 117
**NOTE**: See [README.win32](README.win32) for instructions how to build
          on Windows with Microsoft Visual Studio.

118 119
### Usage in code

M
Magnus Edenhill 已提交
120
See [examples/rdkafka_example.c](https://github.com/edenhill/librdkafka/blob/master/examples/rdkafka_example.c) for an example producer and consumer.
121

M
Magnus Edenhill 已提交
122
Link your program with `-lrdkafka -lz -lpthread -lrt`.
123 124


M
Magnus Edenhill 已提交
125
## Documentation
126

M
Magnus Edenhill 已提交
127
The **C** API is documented in [src/rdkafka.h](src/rdkafka.h)
128

M
Magnus Edenhill 已提交
129
The **C++** API is documented in [src-cpp/rdkafkacpp.h](src-cpp/rdkafkacpp.h)
130

M
Magnus Edenhill 已提交
131 132
Configuration properties are documented in
[CONFIGURATION.md](https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md)
M
Magnus Edenhill 已提交
133

M
Magnus Edenhill 已提交
134 135
For a librdkafka introduction, see
[INTRODUCTION.md](https://github.com/edenhill/librdkafka/blob/master/INTRODUCTION.md)
M
Magnus Edenhill 已提交
136 137


M
Magnus Edenhill 已提交
138
## Examples
M
Magnus Edenhill 已提交
139

M
Magnus Edenhill 已提交
140
See the `examples/`sub-directory.
M
Magnus Edenhill 已提交
141

142

M
Magnus Edenhill 已提交
143
## Tests
144

M
Magnus Edenhill 已提交
145
See the `tests/`sub-directory.
146 147


M
Magnus Edenhill 已提交
148
## Support
149

M
Magnus Edenhill 已提交
150 151
File bug reports, feature requests and questions using
[GitHub Issues](https://github.com/edenhill/librdkafka/issues)
152 153


154
Questions and discussions are also welcome on irc.freenode.org, #apache-kafka,
M
Magnus Edenhill 已提交
155
nickname Snaps.
156

M
Magnus Edenhill 已提交
157

158
### Commercial support
M
Magnus Edenhill 已提交
159

M
Magnus Edenhill 已提交
160
Commercial support is available from [Edenhill services](http://www.edenhill.se)