README.md 4.3 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




M
Magnus Edenhill 已提交
63
#Users of librdkafka#
64

M
Magnus Edenhill 已提交
65 66
  * [Wikimedia's varnishkafka](https://github.com/wikimedia/varnishkafka) - Varnish cache web log producer
  * [kafkacat](https://github.com/edenhill/kafkacat) - Apache Kafka swiss army knife
67 68
  * [syslog-ng](http://syslog-ng.org)
  * [collectd](http://collectd.org)
M
Magnus Edenhill 已提交
69
  * [rsyslog](http://www.rsyslog.com)
70 71
  * [redBorder](http://www.redborder.net)
  * [Headweb](http://www.headweb.com/)
M
Magnus Edenhill 已提交
72 73 74 75 76 77
  * [Produban's log2kafka](https://github.com/Produban/log2kafka) - Web log producer
  * [phpkafka](https://github.com/salebab/phpkafka) - PHP
  * [node-kafka](https://github.com/sutoiku/node-kafka) - Node.js
  * [node-kafkacat](https://github.com/Rafflecopter/node-kafkacat) - Node.js
  * [haskakafka](https://github.com/cosbynator/haskakafka) - Haskell
  * [haskell-kafka](https://github.com/yanatan16/haskell-kafka) - Haskell
M
Magnus Edenhill 已提交
78
  * [Hermann](https://github.com/stancampbell3/Hermann) - Ruby
79
  * [fuse_kafka](https://github.com/yazgoo/fuse_kafka) - FUSE file system layer
M
Magnus Edenhill 已提交
80
  * large unnamed financial institution
M
Magnus Edenhill 已提交
81
  * [OVH](http://ovh.com) - [AntiDDOS](http://www.slideshare.net/hugfrance/hugfr-6-oct2014ovhantiddos)
M
Magnus Edenhill 已提交
82
  * *Let [me](mailto:rdkafka@edenhill.se) know if you are using librdkafka*
83

M
Magnus Edenhill 已提交
84

85 86 87 88 89

# Usage

## Requirements
	The GNU toolchain
90
	GNU make
91 92 93 94 95 96 97
   	pthreads
	zlib

## Instructions

### Building

M
Magnus Edenhill 已提交
98 99
      ./configure
      make
M
Magnus Edenhill 已提交
100
      sudo make install
101 102 103 104


### Usage in code

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

M
Magnus Edenhill 已提交
107
Link your program with `-lrdkafka -lz -lpthread -lrt`.
108 109


M
Magnus Edenhill 已提交
110
## Documentation
111

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

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

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

M
Magnus Edenhill 已提交
119 120
For a librdkafka introduction, see
[INTRODUCTION.md](https://github.com/edenhill/librdkafka/blob/master/INTRODUCTION.md)
M
Magnus Edenhill 已提交
121 122


M
Magnus Edenhill 已提交
123
## Examples
M
Magnus Edenhill 已提交
124

M
Magnus Edenhill 已提交
125
See the `examples/`sub-directory.
M
Magnus Edenhill 已提交
126

127

M
Magnus Edenhill 已提交
128
## Tests
129

M
Magnus Edenhill 已提交
130
See the `tests/`sub-directory.
131 132


M
Magnus Edenhill 已提交
133
## Support
134

M
Magnus Edenhill 已提交
135 136
File bug reports, feature requests and questions using
[GitHub Issues](https://github.com/edenhill/librdkafka/issues)
137 138


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

M
Magnus Edenhill 已提交
142

143
### Commercial support
M
Magnus Edenhill 已提交
144

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