README.md 4.2 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
**NOTE**: The `master` branch is actively developed, use latest release for production use.
M
Magnus Edenhill 已提交
20

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

23
**Apache Kafka 0.8 support:**
M
Magnus Edenhill 已提交
24

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

37

38 39 40 41 42 43 44
**Apache Kafka 0.7 support:**

  * Branch: 0.7
  * Producer: supported
  * Consumer: supported
  * Compression: not supported
  * ZooKeeper: not supported
45
  * C API: backwards compatible with 0.6
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
  * 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 已提交
61
#Users of librdkafka#
62

M
Magnus Edenhill 已提交
63 64
  * [Wikimedia's varnishkafka](https://github.com/wikimedia/varnishkafka) - Varnish cache web log producer
  * [kafkacat](https://github.com/edenhill/kafkacat) - Apache Kafka swiss army knife
65 66
  * [syslog-ng](http://syslog-ng.org)
  * [collectd](http://collectd.org)
M
Magnus Edenhill 已提交
67
  * [rsyslog](http://www.rsyslog.com)
68 69
  * [redBorder](http://www.redborder.net)
  * [Headweb](http://www.headweb.com/)
M
Magnus Edenhill 已提交
70 71 72 73 74 75
  * [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 已提交
76
  * [Hermann](https://github.com/stancampbell3/Hermann) - Ruby
77
  * [fuse_kafka](https://github.com/yazgoo/fuse_kafka) - FUSE file system layer
M
Magnus Edenhill 已提交
78
  * large unnamed financial institution
M
Magnus Edenhill 已提交
79
  * [OVH](http://ovh.com) - [AntiDDOS](http://www.slideshare.net/hugfrance/hugfr-6-oct2014ovhantiddos)
M
Magnus Edenhill 已提交
80
  * *Let [me](mailto:rdkafka@edenhill.se) know if you are using librdkafka*
81

M
Magnus Edenhill 已提交
82

83 84 85 86 87

# Usage

## Requirements
	The GNU toolchain
88
	GNU make
89 90 91 92 93 94 95
   	pthreads
	zlib

## Instructions

### Building

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


### Usage in code

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

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


M
Magnus Edenhill 已提交
108
## Documentation
109

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

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

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

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


M
Magnus Edenhill 已提交
121
## Examples
M
Magnus Edenhill 已提交
122

M
Magnus Edenhill 已提交
123
See the `examples/`sub-directory.
M
Magnus Edenhill 已提交
124

125

M
Magnus Edenhill 已提交
126
## Tests
127

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


M
Magnus Edenhill 已提交
131
## Support
132

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


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

M
Magnus Edenhill 已提交
140

141
### Commercial support
M
Magnus Edenhill 已提交
142

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