You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-19Lines changed: 26 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
# About the `Modern C++ based Kafka API`
1
+
# About the *Modern C++ Kafka API*
2
2
3
3
## Introduction
4
4
5
-
The `Modern C++ based Kafka API` (`modern-cpp-kafka`) is a layer of C++ wrapper based on [librdkafka](https://github.com/edenhill/librdkafka) (the C part), with high quality, but more friendly to users.
5
+
The [Modern C++ Kafka API](http://opensource.morganstanley.com/modern-cpp-kafka/doxygen/annotated.html) is a layer of C++ wrapper based on [librdkafka](https://github.com/edenhill/librdkafka) (the C part), with high quality, but more friendly to users.
6
6
7
-
- By now, `modern-cpp-kafka` is compatible with `librdkafka`**v1.7.0**.
7
+
- By now, [modern-cpp-kafka](https://github.com/morganstanley/modern-cpp-kafka) is compatible with [librdkafkav1.7.0](https://github.com/edenhill/librdkafka/releases/tag/v1.7.0).
8
8
9
9
```
10
10
KAFKA is a registered trademark of The Apache Software Foundation and
@@ -14,13 +14,13 @@ affiliation with and is not endorsed by The Apache Software Foundation.
14
14
15
15
## Why it's here
16
16
17
-
The `librdkafka` is a robust high performance C/C++ library, widely used and well maintained.
17
+
The ***librdkafka*** is a robust high performance C/C++ library, widely used and well maintained.
18
18
19
-
Unfortunately, to maintain C++98 compatibility, the C++ interface of `librdkafka` is not quite object-oriented or user-friendly.
19
+
Unfortunately, to maintain C++98 compatibility, the C++ interface of ***librdkafka*** is not quite object-oriented or user-friendly.
20
20
21
21
Since C++ is evolving quickly, we want to take advantage of new C++ features, thus make the life easier for developers. And this led us to create a new C++ API for Kafka clients.
22
22
23
-
Eventually, we worked out the `modern-cpp-kafka`, -- a header-only library that uses idiomatic C++ features to provide a safe, efficient and easy to use way of producing and consuming Kafka messages.
23
+
Eventually, we worked out the ***modern-cpp-kafka***, -- a header-only library that uses idiomatic C++ features to provide a safe, efficient and easy to use way of producing and consuming Kafka messages.
24
24
25
25
## Features
26
26
@@ -36,7 +36,7 @@ Eventually, we worked out the `modern-cpp-kafka`, -- a header-only library that
36
36
37
37
* RAII is used for lifetime management
38
38
39
-
* librdkafka's polling and queue management is now hidden
39
+
****librdkafka***'s polling and queue management is now hidden
40
40
41
41
* Robust
42
42
@@ -63,11 +63,11 @@ Eventually, we worked out the `modern-cpp-kafka`, -- a header-only library that
63
63
64
64
* Specify library locations with environment variables
65
65
66
-
* `LIBRDKAFKA_ROOT` -- `librdkafka` headers and libraries
66
+
* `LIBRDKAFKA_ROOT` -- ***librdkafka*** headers and libraries
67
67
68
-
* `GTEST_ROOT` -- `googletest` headers and libraries
68
+
* `GTEST_ROOT` -- ***googletest*** headers and libraries
69
69
70
-
* `BOOST_ROOT` -- `boost` headers and libraries
70
+
* `BOOST_ROOT` -- ***boost*** headers and libraries
71
71
72
72
* `SASL_LIBRARYDIR`/`SASL_LIBRARY` -- if SASL connection support is wanted
73
73
@@ -89,7 +89,7 @@ Eventually, we worked out the `modern-cpp-kafka`, -- a header-only library that
89
89
90
90
*`BUILD_OPTION_GEN_DOC=ON` -- Generate documentation as well
91
91
92
-
*`BUILD_OPTION_DOC_ONLY=ON`-- Only generate documentation
92
+
*`BUILD_OPTION_DOC_ONLY=ON` -- Only generate documentation
93
93
94
94
*`BUILD_OPTION_GEN_COVERAGE=ON` -- Generate test coverage, only support by clang currently
95
95
@@ -99,13 +99,13 @@ Eventually, we worked out the `modern-cpp-kafka`, -- a header-only library that
99
99
100
100
* Include the `include/kafka` directory in your project
101
101
102
-
* To work together with `modern-cpp-kafka` API, the compiler should support
102
+
* To work together with ***modern-cpp-kafka*** API, the compiler should support
103
103
104
104
* Option 1: C++17
105
105
106
106
* Option 2: C++14 (with pre-requirements)
107
107
108
-
* Need `boost` headers (for `boost::optional`)
108
+
* Need ***boost*** headers (for `boost::optional`)
109
109
110
110
* GCC only (with optimization, e.g. -O2)
111
111
@@ -135,6 +135,14 @@ Eventually, we worked out the `modern-cpp-kafka`, -- a header-only library that
135
135
136
136
* E.g. `export KAFKA_BROKER_PIDS=61567,61569,61571`
137
137
138
+
* Additional settings for clients
139
+
140
+
* The environment variable `KAFKA_CLIENT_ADDITIONAL_SETTINGS` could be used for customized test environment
141
+
142
+
* Especially for Kafka cluster with SASL(or SSL) connections
143
+
144
+
* E.g. `export KAFKA_CLIENT_ADDITIONAL_SETTINGS="security.protocol=SASL_PLAINTEXT;sasl.kerberos.service.name=...;sasl.kerberos.keytab=...;sasl.kerberos.principal=..."`
145
+
138
146
## To Start
139
147
140
148
* Tutorial
@@ -147,23 +155,22 @@ Eventually, we worked out the `modern-cpp-kafka`, -- a header-only library that
* In most cases, the `Properties`setting in `modern-cpp-kafka` is identical with [librdkafka configuration](https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md)
163
+
* In most cases, the `Properties`settings for ***modern-cpp-kafka*** are identical with [librdkafka configuration](https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md)
157
164
158
165
* With following exceptions
159
166
160
167
* KafkaConsumer
161
168
162
-
* More properties than `librdkafka`
169
+
* More properties than ***librdkafka***
163
170
164
171
* `max.poll.records` (default: `500`): The maxmum number of records that a single call to `poll()` would return
165
172
166
-
* Properties not supposed to be used (internally shadowed by `modern-cpp-kafka`)
173
+
* Properties not supposed to be used (internally shadowed by ***modern-cpp-kafka***)
167
174
168
175
* `enable.auto.offset.store`
169
176
@@ -179,7 +186,7 @@ Eventually, we worked out the `modern-cpp-kafka`, -- a header-only library that
0 commit comments