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

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 19
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 已提交
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
27
  * Debian package: work in progress (separate "debian" branch)
28 29
  * ZooKeeper: not supported
  * API: not backwards compatible
M
Magnus Edenhill 已提交
30
  * Tests: Regression tests in `tests/` directory.
31
  * Status: Testing, APIs subject to change.
M
Magnus Edenhill 已提交
32

33

34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
**Apache Kafka 0.7 support:**

  * Branch: 0.7
  * Producer: supported
  * Consumer: supported
  * Compression: not supported
  * ZooKeeper: not supported
  * API: backwards compatible with 0.6
  * 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 已提交
57
#Users of librdkafka#
58

59
  * [Wikimedia's varnishkafka](https://github.com/wikimedia/varnishkafka)
60 61
  * [redBorder](http://www.redborder.net)
  * [Headweb](http://www.headweb.com/)
M
Magnus Edenhill 已提交
62
  * *Let [me](mailto:rdkafka@edenhill.se) know if you are using librdkafka*
63

M
Magnus Edenhill 已提交
64

65 66 67 68 69 70 71 72 73 74 75 76 77

# Usage

## Requirements
	The GNU toolchain
   	pthreads
	zlib

## Instructions

### Building

      make all
M
Magnus Edenhill 已提交
78 79 80
      sudo make install
      # or to install in another location than /usr/local, set DESTDIR env
      # to the filesystem root of your choice.
81
      sudo make DESTDIR=/usr make install
82 83 84 85


### Usage in code

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

M
Magnus Edenhill 已提交
88
Link your program with `-lrdkafka -lz -lpthread -lrt`.
89 90


M
Magnus Edenhill 已提交
91
## Documentation
92

M
Magnus Edenhill 已提交
93
The API is documented in `rdkafka.h`
94

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

M
Magnus Edenhill 已提交
98 99
For a librdkafka introduction, see
[INTRODUCTION.md](https://github.com/edenhill/librdkafka/blob/master/INTRODUCTION.md)
M
Magnus Edenhill 已提交
100 101


M
Magnus Edenhill 已提交
102
## Examples
M
Magnus Edenhill 已提交
103

M
Magnus Edenhill 已提交
104
See the `examples/`sub-directory.
M
Magnus Edenhill 已提交
105

106

M
Magnus Edenhill 已提交
107
## Tests
108

M
Magnus Edenhill 已提交
109
See the `tests/`sub-directory.
110 111


M
Magnus Edenhill 已提交
112
## Support
113

M
Magnus Edenhill 已提交
114 115
File bug reports, feature requests and questions using
[GitHub Issues](https://github.com/edenhill/librdkafka/issues)
116 117


M
Magnus Edenhill 已提交
118 119
Questions and discussions are also welcome on irc.freenode.org, #kafka,
nickname Snaps.
120

M
Magnus Edenhill 已提交
121

M
Magnus Edenhill 已提交
122
### Commerical support
M
Magnus Edenhill 已提交
123

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