Skip to content

Commit a8c923a

Browse files
authored
Changed: config defaults to be aligned with Kafka client defaults (#30)
1 parent 818a3a2 commit a8c923a

File tree

9 files changed

+210
-149
lines changed

9 files changed

+210
-149
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 10.2.0
2+
- Changed: config defaults to be aligned with Kafka client defaults [#30](https://github.com/logstash-plugins/logstash-integration-kafka/pull/30)
3+
14
## 10.1.0
25
- updated kafka client (and its dependencies) to version 2.4.1 ([#16](https://github.com/logstash-plugins/logstash-integration-kafka/pull/16))
36
- added the input `client_rack` parameter to enable support for follower fetching

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ task :default do
88
end
99

1010
task :vendor do
11-
exit(1) unless system './gradlew vendor'
11+
exit(1) unless system './gradlew --no-daemon vendor'
1212
end
1313

1414
task :clean do

docs/index.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ The Kafka Integration Plugin provides integrated plugins for working with the ht
2626
- {logstash-ref}/plugins-inputs-kafka.html[Kafka Input Plugin]
2727
- {logstash-ref}/plugins-outputs-kafka.html[Kafka Output Plugin]
2828

29-
This plugin uses Kafka Client 2.3.0. For broker compatibility, see the official https://cwiki.apache.org/confluence/display/KAFKA/Compatibility+Matrix[Kafka compatibility reference]. If the linked compatibility wiki is not up-to-date, please contact Kafka support/community to confirm compatibility.
29+
This plugin uses Kafka Client 2.4. For broker compatibility, see the official https://cwiki.apache.org/confluence/display/KAFKA/Compatibility+Matrix[Kafka compatibility reference]. If the linked compatibility wiki is not up-to-date, please contact Kafka support/community to confirm compatibility.
3030

3131
:no_codec!:

docs/input-kafka.asciidoc

Lines changed: 70 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ the same `group_id`.
4646
Ideally you should have as many threads as the number of partitions for a perfect balance --
4747
more threads than partitions means that some threads will be idle
4848

49-
For more information see http://kafka.apache.org/documentation.html#theconsumer
49+
For more information see https://kafka.apache.org/24/documentation.html#theconsumer
5050

51-
Kafka consumer configuration: http://kafka.apache.org/documentation.html#consumerconfigs
51+
Kafka consumer configuration: https://kafka.apache.org/24/documentation.html#consumerconfigs
5252

5353
==== Metadata fields
5454

@@ -71,46 +71,48 @@ inserted into your original event, you'll have to use the `mutate` filter to man
7171

7272
This plugin supports these configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
7373

74-
NOTE: Some of these options map to a Kafka option. See the https://kafka.apache.org/documentation for more details.
74+
NOTE: Some of these options map to a Kafka option. Defaults usually reflect the Kafka default setting,
75+
and might change if Kafka's consumer defaults change.
76+
See the https://kafka.apache.org/24/documentation for more details.
7577

7678
[cols="<,<,<",options="header",]
7779
|=======================================================================
7880
|Setting |Input type|Required
79-
| <<plugins-{type}s-{plugin}-auto_commit_interval_ms>> |<<string,string>>|No
81+
| <<plugins-{type}s-{plugin}-auto_commit_interval_ms>> |<<number,number>>|No
8082
| <<plugins-{type}s-{plugin}-auto_offset_reset>> |<<string,string>>|No
8183
| <<plugins-{type}s-{plugin}-bootstrap_servers>> |<<string,string>>|No
82-
| <<plugins-{type}s-{plugin}-check_crcs>> |<<string,string>>|No
84+
| <<plugins-{type}s-{plugin}-check_crcs>> |<<boolean,boolean>>|No
8385
| <<plugins-{type}s-{plugin}-client_id>> |<<string,string>>|No
8486
| <<plugins-{type}s-{plugin}-client_rack>> |<<string,string>>|No
85-
| <<plugins-{type}s-{plugin}-connections_max_idle_ms>> |<<string,string>>|No
87+
| <<plugins-{type}s-{plugin}-connections_max_idle_ms>> |<<number,number>>|No
8688
| <<plugins-{type}s-{plugin}-consumer_threads>> |<<number,number>>|No
8789
| <<plugins-{type}s-{plugin}-decorate_events>> |<<boolean,boolean>>|No
88-
| <<plugins-{type}s-{plugin}-enable_auto_commit>> |<<string,string>>|No
90+
| <<plugins-{type}s-{plugin}-enable_auto_commit>> |<<boolean,boolean>>|No
8991
| <<plugins-{type}s-{plugin}-exclude_internal_topics>> |<<string,string>>|No
90-
| <<plugins-{type}s-{plugin}-fetch_max_bytes>> |<<string,string>>|No
91-
| <<plugins-{type}s-{plugin}-fetch_max_wait_ms>> |<<string,string>>|No
92-
| <<plugins-{type}s-{plugin}-fetch_min_bytes>> |<<string,string>>|No
92+
| <<plugins-{type}s-{plugin}-fetch_max_bytes>> |<<number,number>>|No
93+
| <<plugins-{type}s-{plugin}-fetch_max_wait_ms>> |<<number,number>>|No
94+
| <<plugins-{type}s-{plugin}-fetch_min_bytes>> |<<number,number>>|No
9395
| <<plugins-{type}s-{plugin}-group_id>> |<<string,string>>|No
94-
| <<plugins-{type}s-{plugin}-heartbeat_interval_ms>> |<<string,string>>|No
96+
| <<plugins-{type}s-{plugin}-heartbeat_interval_ms>> |<<number,number>>|No
9597
| <<plugins-{type}s-{plugin}-jaas_path>> |a valid filesystem path|No
9698
| <<plugins-{type}s-{plugin}-kerberos_config>> |a valid filesystem path|No
9799
| <<plugins-{type}s-{plugin}-key_deserializer_class>> |<<string,string>>|No
98-
| <<plugins-{type}s-{plugin}-max_partition_fetch_bytes>> |<<string,string>>|No
99-
| <<plugins-{type}s-{plugin}-max_poll_interval_ms>> |<<string,string>>|No
100-
| <<plugins-{type}s-{plugin}-max_poll_records>> |<<string,string>>|No
101-
| <<plugins-{type}s-{plugin}-metadata_max_age_ms>> |<<string,string>>|No
100+
| <<plugins-{type}s-{plugin}-max_partition_fetch_bytes>> |<<number,number>>|No
101+
| <<plugins-{type}s-{plugin}-max_poll_interval_ms>> |<<number,number>>|No
102+
| <<plugins-{type}s-{plugin}-max_poll_records>> |<<number,number>>|No
103+
| <<plugins-{type}s-{plugin}-metadata_max_age_ms>> |<<number,number>>|No
102104
| <<plugins-{type}s-{plugin}-partition_assignment_strategy>> |<<string,string>>|No
103105
| <<plugins-{type}s-{plugin}-poll_timeout_ms>> |<<number,number>>|No
104-
| <<plugins-{type}s-{plugin}-receive_buffer_bytes>> |<<string,string>>|No
105-
| <<plugins-{type}s-{plugin}-reconnect_backoff_ms>> |<<string,string>>|No
106-
| <<plugins-{type}s-{plugin}-request_timeout_ms>> |<<string,string>>|No
107-
| <<plugins-{type}s-{plugin}-retry_backoff_ms>> |<<string,string>>|No
106+
| <<plugins-{type}s-{plugin}-receive_buffer_bytes>> |<<number,number>>|No
107+
| <<plugins-{type}s-{plugin}-reconnect_backoff_ms>> |<<number,number>>|No
108+
| <<plugins-{type}s-{plugin}-request_timeout_ms>> |<<number,number>>|No
109+
| <<plugins-{type}s-{plugin}-retry_backoff_ms>> |<<number,number>>|No
108110
| <<plugins-{type}s-{plugin}-sasl_jaas_config>> |<<string,string>>|No
109111
| <<plugins-{type}s-{plugin}-sasl_kerberos_service_name>> |<<string,string>>|No
110112
| <<plugins-{type}s-{plugin}-sasl_mechanism>> |<<string,string>>|No
111113
| <<plugins-{type}s-{plugin}-security_protocol>> |<<string,string>>, one of `["PLAINTEXT", "SSL", "SASL_PLAINTEXT", "SASL_SSL"]`|No
112-
| <<plugins-{type}s-{plugin}-send_buffer_bytes>> |<<string,string>>|No
113-
| <<plugins-{type}s-{plugin}-session_timeout_ms>> |<<string,string>>|No
114+
| <<plugins-{type}s-{plugin}-send_buffer_bytes>> |<<number,number>>|No
115+
| <<plugins-{type}s-{plugin}-session_timeout_ms>> |<<number,number>>|No
114116
| <<plugins-{type}s-{plugin}-ssl_endpoint_identification_algorithm>> |<<string,string>>|No
115117
| <<plugins-{type}s-{plugin}-ssl_key_password>> |<<password,password>>|No
116118
| <<plugins-{type}s-{plugin}-ssl_keystore_location>> |a valid filesystem path|No
@@ -132,8 +134,8 @@ input plugins.
132134
[id="plugins-{type}s-{plugin}-auto_commit_interval_ms"]
133135
===== `auto_commit_interval_ms`
134136

135-
* Value type is <<string,string>>
136-
* Default value is `"5000"`
137+
* Value type is <<number,number>>
138+
* Default value is `5000`.
137139

138140
The frequency in milliseconds that the consumer offsets are committed to Kafka.
139141

@@ -165,12 +167,12 @@ case a server is down).
165167
[id="plugins-{type}s-{plugin}-check_crcs"]
166168
===== `check_crcs`
167169

168-
* Value type is <<string,string>>
169-
* There is no default value for this setting.
170+
* Value type is <<boolean,boolean>>
171+
* Default value is `true`
170172

171-
Automatically check the CRC32 of the records consumed. This ensures no on-the-wire or on-disk
172-
corruption to the messages occurred. This check adds some overhead, so it may be
173-
disabled in cases seeking extreme performance.
173+
Automatically check the CRC32 of the records consumed.
174+
This ensures no on-the-wire or on-disk corruption to the messages occurred.
175+
This check adds some overhead, so it may be disabled in cases seeking extreme performance.
174176

175177
[id="plugins-{type}s-{plugin}-client_id"]
176178
===== `client_id`
@@ -198,8 +200,8 @@ https://cwiki.apache.org/confluence/display/KAFKA/KIP-392%3A+Allow+consumers+to+
198200
[id="plugins-{type}s-{plugin}-connections_max_idle_ms"]
199201
===== `connections_max_idle_ms`
200202

201-
* Value type is <<string,string>>
202-
* There is no default value for this setting.
203+
* Value type is <<number,number>>
204+
* Default value is `540000` milliseconds (9 minutes).
203205

204206
Close idle connections after the number of milliseconds specified by this config.
205207

@@ -230,8 +232,8 @@ This will add a field named `kafka` to the logstash event containing the followi
230232
[id="plugins-{type}s-{plugin}-enable_auto_commit"]
231233
===== `enable_auto_commit`
232234

233-
* Value type is <<string,string>>
234-
* Default value is `"true"`
235+
* Value type is <<boolean,boolean>>
236+
* Default value is `true`
235237

236238
This committed offset will be used when the process fails as the position from
237239
which the consumption will begin.
@@ -252,8 +254,8 @@ If set to true the only way to receive records from an internal topic is subscri
252254
[id="plugins-{type}s-{plugin}-fetch_max_bytes"]
253255
===== `fetch_max_bytes`
254256

255-
* Value type is <<string,string>>
256-
* There is no default value for this setting.
257+
* Value type is <<number,number>>
258+
* Default value is `52428800` (50MB)
257259

258260
The maximum amount of data the server should return for a fetch request. This is not an
259261
absolute maximum, if the first message in the first non-empty partition of the fetch is larger
@@ -262,8 +264,8 @@ than this value, the message will still be returned to ensure that the consumer
262264
[id="plugins-{type}s-{plugin}-fetch_max_wait_ms"]
263265
===== `fetch_max_wait_ms`
264266

265-
* Value type is <<string,string>>
266-
* There is no default value for this setting.
267+
* Value type is <<number,number>>
268+
* Default value is `500` milliseconds.
267269

268270
The maximum amount of time the server will block before answering the fetch request if
269271
there isn't sufficient data to immediately satisfy `fetch_min_bytes`. This
@@ -272,7 +274,7 @@ should be less than or equal to the timeout used in `poll_timeout_ms`
272274
[id="plugins-{type}s-{plugin}-fetch_min_bytes"]
273275
===== `fetch_min_bytes`
274276

275-
* Value type is <<string,string>>
277+
* Value type is <<number,number>>
276278
* There is no default value for this setting.
277279

278280
The minimum amount of data the server should return for a fetch request. If insufficient
@@ -292,8 +294,8 @@ Logstash instances with the same `group_id`
292294
[id="plugins-{type}s-{plugin}-heartbeat_interval_ms"]
293295
===== `heartbeat_interval_ms`
294296

295-
* Value type is <<string,string>>
296-
* There is no default value for this setting.
297+
* Value type is <<number,number>>
298+
* Default value is `3000` milliseconds (3 seconds).
297299

298300
The expected time between heartbeats to the consumer coordinator. Heartbeats are used to ensure
299301
that the consumer's session stays active and to facilitate rebalancing when new
@@ -343,8 +345,8 @@ Java Class used to deserialize the record's key
343345
[id="plugins-{type}s-{plugin}-max_partition_fetch_bytes"]
344346
===== `max_partition_fetch_bytes`
345347

346-
* Value type is <<string,string>>
347-
* There is no default value for this setting.
348+
* Value type is <<number,number>>
349+
* Default value is `1048576` (1MB).
348350

349351
The maximum amount of data per-partition the server will return. The maximum total memory used for a
350352
request will be `#partitions * max.partition.fetch.bytes`. This size must be at least
@@ -355,28 +357,28 @@ to fetch a large message on a certain partition.
355357
[id="plugins-{type}s-{plugin}-max_poll_interval_ms"]
356358
===== `max_poll_interval_ms`
357359

358-
* Value type is <<string,string>>
359-
* There is no default value for this setting.
360+
* Value type is <<number,number>>
361+
* Default value is `300000` milliseconds (5 minutes).
360362

361363
The maximum delay between invocations of poll() when using consumer group management. This places
362364
an upper bound on the amount of time that the consumer can be idle before fetching more records.
363365
If poll() is not called before expiration of this timeout, then the consumer is considered failed and
364366
the group will rebalance in order to reassign the partitions to another member.
365-
The value of the configuration `request_timeout_ms` must always be larger than max_poll_interval_ms
367+
The value of the configuration `request_timeout_ms` must always be larger than `max_poll_interval_ms`. ???
366368

367369
[id="plugins-{type}s-{plugin}-max_poll_records"]
368370
===== `max_poll_records`
369371

370-
* Value type is <<string,string>>
371-
* There is no default value for this setting.
372+
* Value type is <<number,number>>
373+
* Default value is `500`.
372374

373375
The maximum number of records returned in a single call to poll().
374376

375377
[id="plugins-{type}s-{plugin}-metadata_max_age_ms"]
376378
===== `metadata_max_age_ms`
377379

378-
* Value type is <<string,string>>
379-
* There is no default value for this setting.
380+
* Value type is <<number,number>>
381+
* Default value is `300000` milliseconds (5 minutes).
380382

381383
The period of time in milliseconds after which we force a refresh of metadata even if
382384
we haven't seen any partition leadership changes to proactively discover any new brokers or partitions
@@ -402,23 +404,28 @@ implementations.
402404
===== `poll_timeout_ms`
403405

404406
* Value type is <<number,number>>
405-
* Default value is `100`
407+
* Default value is `100` milliseconds.
406408

407-
Time kafka consumer will wait to receive new messages from topics
409+
Time Kafka consumer will wait to receive new messages from topics.
410+
411+
After subscribing to a set of topics, the Kafka consumer automatically joins the group when polling.
412+
The plugin poll-ing in a loop ensures consumer liveness.
413+
Underneath the covers, Kafka client sends periodic heartbeats to the server.
414+
The timeout specified the time to block waiting for input on each poll.
408415

409416
[id="plugins-{type}s-{plugin}-receive_buffer_bytes"]
410417
===== `receive_buffer_bytes`
411418

412-
* Value type is <<string,string>>
413-
* There is no default value for this setting.
419+
* Value type is <<number,number>>
420+
* Default value is `32768` (32KB).
414421

415422
The size of the TCP receive buffer (SO_RCVBUF) to use when reading data.
416423

417424
[id="plugins-{type}s-{plugin}-reconnect_backoff_ms"]
418425
===== `reconnect_backoff_ms`
419426

420-
* Value type is <<string,string>>
421-
* There is no default value for this setting.
427+
* Value type is <<number,number>>
428+
* Default value is `50` milliseconds.
422429

423430
The amount of time to wait before attempting to reconnect to a given host.
424431
This avoids repeatedly connecting to a host in a tight loop.
@@ -427,8 +434,8 @@ This backoff applies to all requests sent by the consumer to the broker.
427434
[id="plugins-{type}s-{plugin}-request_timeout_ms"]
428435
===== `request_timeout_ms`
429436

430-
* Value type is <<string,string>>
431-
* There is no default value for this setting.
437+
* Value type is <<number,number>>
438+
* Default value is `40000` milliseconds (40 seconds).
432439

433440
The configuration controls the maximum amount of time the client will wait
434441
for the response of a request. If the response is not received before the timeout
@@ -438,8 +445,8 @@ retries are exhausted.
438445
[id="plugins-{type}s-{plugin}-retry_backoff_ms"]
439446
===== `retry_backoff_ms`
440447

441-
* Value type is <<string,string>>
442-
* There is no default value for this setting.
448+
* Value type is <<number,number>>
449+
* Default value is `100` milliseconds.
443450

444451
The amount of time to wait before attempting to retry a failed fetch request
445452
to a given topic partition. This avoids repeated fetching-and-failing in a tight loop.
@@ -492,16 +499,16 @@ Security protocol to use, which can be either of PLAINTEXT,SSL,SASL_PLAINTEXT,SA
492499
[id="plugins-{type}s-{plugin}-send_buffer_bytes"]
493500
===== `send_buffer_bytes`
494501

495-
* Value type is <<string,string>>
496-
* There is no default value for this setting.
502+
* Value type is <<number,number>>
503+
* Default value is `131072` (128KB).
497504

498505
The size of the TCP send buffer (SO_SNDBUF) to use when sending data
499506

500507
[id="plugins-{type}s-{plugin}-session_timeout_ms"]
501508
===== `session_timeout_ms`
502509

503-
* Value type is <<string,string>>
504-
* There is no default value for this setting.
510+
* Value type is <<number,number>>
511+
* Default value is `10000` milliseconds (10 seconds).
505512

506513
The timeout after which, if the `poll_timeout_ms` is not invoked, the consumer is marked dead
507514
and a rebalance operation is triggered for the group identified by `group_id`
@@ -561,7 +568,7 @@ The JKS truststore path to validate the Kafka broker's certificate.
561568
* Value type is <<password,password>>
562569
* There is no default value for this setting.
563570

564-
The truststore password
571+
The truststore password.
565572

566573
[id="plugins-{type}s-{plugin}-ssl_truststore_type"]
567574
===== `ssl_truststore_type`

0 commit comments

Comments
 (0)