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

4
Copyright (c) 2012-2013, [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

21
**Apache Kafka 0.8 support:**
M
Magnus Edenhill 已提交
22

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

35

36 37 38 39 40 41 42
**Apache Kafka 0.7 support:**

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

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

M
Magnus Edenhill 已提交
76

77 78 79 80 81

# Usage

## Requirements
	The GNU toolchain
82
	GNU make
83 84 85 86 87 88 89
   	pthreads
	zlib

## Instructions

### Building

M
Magnus Edenhill 已提交
90 91
      ./configure
      make
M
Magnus Edenhill 已提交
92
      sudo make install
93 94 95 96


### Usage in code

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

M
Magnus Edenhill 已提交
99
Link your program with `-lrdkafka -lz -lpthread -lrt`.
100 101


M
Magnus Edenhill 已提交
102
## Documentation
103

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

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

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

M
Magnus Edenhill 已提交
111 112
For a librdkafka introduction, see
[INTRODUCTION.md](https://github.com/edenhill/librdkafka/blob/master/INTRODUCTION.md)
M
Magnus Edenhill 已提交
113 114


M
Magnus Edenhill 已提交
115
## Examples
M
Magnus Edenhill 已提交
116

M
Magnus Edenhill 已提交
117
See the `examples/`sub-directory.
M
Magnus Edenhill 已提交
118

119

M
Magnus Edenhill 已提交
120
## Tests
121

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


M
Magnus Edenhill 已提交
125
## Support
126

M
Magnus Edenhill 已提交
127 128
File bug reports, feature requests and questions using
[GitHub Issues](https://github.com/edenhill/librdkafka/issues)
129 130


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

M
Magnus Edenhill 已提交
134

135
### Commercial support
M
Magnus Edenhill 已提交
136

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