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: doc/KafkaConsumerQuickStart.md
+1-5Lines changed: 1 addition & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -191,15 +191,11 @@ About `Error`'s `value()`s, there are 2 cases
191
191
192
192
* How many threads would be created by a KafkaConsumer?
193
193
194
-
Excluding the user's main thread, if `enable.auto.commit` is `false`, the `KafkaConsumer` would start another (N + 2) threads in the background; otherwise, the `KafkaConsumer` would start (N + 3) background threads. (N means the number of BOOTSTRAP_SERVERS)
195
-
196
194
1. Each broker (in the list of BOOTSTRAP_SERVERS) would take a seperate thread to transmit messages towards a kafka cluster server.
197
195
198
196
2. Another 3 threads will handle internal operations, consumer group operations, and kinds of timers, etc.
199
197
200
-
3. To enable the auto commit, one more thread would be create, which keeps polling/processing the offset-commit callback event.
201
-
202
-
E.g, if a KafkaConsumer was created with property of `BOOTSTRAP_SERVERS=127.0.0.1:8888,127.0.0.1:8889,127.0.0.1:8890`, it would take 6 threads in total (including the main thread).
198
+
3. To enable the auto events-polling, one more background thread would be created, which keeps polling/processing the offset-commit callback event.
203
199
204
200
* Which one of these threads will handle the callbacks?
Copy file name to clipboardExpand all lines: doc/KafkaProducerQuickStart.md
+2-6Lines changed: 2 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,19 +199,15 @@ Larger `QUEUE_BUFFERING_MAX_MESSAGES`/`QUEUE_BUFFERING_MAX_KBYTES` might help to
199
199
200
200
### How many threads would be created by a KafkaProducer?
201
201
202
-
Excluding the user's main thread, `KafkaProducer` would start (N + 3) background threads. (N means the number of BOOTSTRAP_SERVERS)
203
-
204
202
Most of these background threads are started internally by librdkafka.
205
203
206
204
Here is a brief introduction what they're used for,
207
205
208
206
1. Each broker (in the list of BOOTSTRAP_SERVERS) would take a separate thread to transmit messages towards a kafka cluster server.
209
207
210
-
2. Another 2 background threads would handle internal operations and kinds of timers, etc.
211
-
212
-
3. One more background thread to keep polling the delivery callback event.
208
+
2. Another 2 threads would handle internal operations and kinds of timers, etc.
213
209
214
-
E.g, if a `KafkaProducer` was created with property of `BOOTSTRAP_SERVERS=127.0.0.1:8888,127.0.0.1:8889,127.0.0.1:8890`, it would take 7 threads in total (including the main thread).
210
+
3. To enale the auto events-polling, one more background thread would be created, which keeps polling the delivery callback event.
215
211
216
212
### Which one of these threads will handle the callbacks
0 commit comments