Skip to content

Commit 4493364

Browse files
committed
Changed expected datatype of various options to number:
`auto_commit_interval_ms`, `connections_max_idle_ms`, `fetch_max_bytes`, `fetch_max_wait_ms`, `fetch_min_bytes`, `heartbeat_interval_ms`, `max_partition_fetch_bytes`, `max_poll_interval_ms`, `max_poll_records`, `metadata_max_age_ms`, `receive_buffer_bytes`, `reconnect_backoff_ms`, `request_timeout_ms`, `retry_backoff_ms`, `send_buffer_bytes`, `session_timeout_ms`
1 parent 4adfec6 commit 4493364

File tree

4 files changed

+58
-50
lines changed

4 files changed

+58
-50
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 10.0.0
2+
- Changed expected datatype of various options to number:
3+
`auto_commit_interval_ms`, `connections_max_idle_ms`, `fetch_max_bytes`, `fetch_max_wait_ms`,
4+
`fetch_min_bytes`, `heartbeat_interval_ms`, `max_partition_fetch_bytes`, `max_poll_interval_ms`,
5+
`max_poll_records`, `metadata_max_age_ms`, `receive_buffer_bytes`, `reconnect_backoff_ms`,
6+
`request_timeout_ms`, `retry_backoff_ms`, `send_buffer_bytes`, `session_timeout_ms`
7+
[#309](https://github.com/logstash-plugins/logstash-input-kafka/pull/309)
8+
19
## 9.0.0
210
- Removed obsolete `ssl` option
311

docs/index.asciidoc

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -77,39 +77,39 @@ https://kafka.apache.org/documentation for more details.
7777
[cols="<,<,<",options="header",]
7878
|=======================================================================
7979
|Setting |Input type|Required
80-
| <<plugins-{type}s-{plugin}-auto_commit_interval_ms>> |<<string,string>>|No
80+
| <<plugins-{type}s-{plugin}-auto_commit_interval_ms>> |<<number,number>>|No
8181
| <<plugins-{type}s-{plugin}-auto_offset_reset>> |<<string,string>>|No
8282
| <<plugins-{type}s-{plugin}-bootstrap_servers>> |<<string,string>>|No
8383
| <<plugins-{type}s-{plugin}-check_crcs>> |<<string,string>>|No
8484
| <<plugins-{type}s-{plugin}-client_id>> |<<string,string>>|No
85-
| <<plugins-{type}s-{plugin}-connections_max_idle_ms>> |<<string,string>>|No
85+
| <<plugins-{type}s-{plugin}-connections_max_idle_ms>> |<<number,number>>|No
8686
| <<plugins-{type}s-{plugin}-consumer_threads>> |<<number,number>>|No
8787
| <<plugins-{type}s-{plugin}-decorate_events>> |<<boolean,boolean>>|No
8888
| <<plugins-{type}s-{plugin}-enable_auto_commit>> |<<string,string>>|No
8989
| <<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
90+
| <<plugins-{type}s-{plugin}-fetch_max_bytes>> |<<number,number>>|No
91+
| <<plugins-{type}s-{plugin}-fetch_max_wait_ms>> |<<number,number>>|No
92+
| <<plugins-{type}s-{plugin}-fetch_min_bytes>> |<<number,number>>|No
9393
| <<plugins-{type}s-{plugin}-group_id>> |<<string,string>>|No
94-
| <<plugins-{type}s-{plugin}-heartbeat_interval_ms>> |<<string,string>>|No
94+
| <<plugins-{type}s-{plugin}-heartbeat_interval_ms>> |<<number,number>>|No
9595
| <<plugins-{type}s-{plugin}-jaas_path>> |a valid filesystem path|No
9696
| <<plugins-{type}s-{plugin}-kerberos_config>> |a valid filesystem path|No
9797
| <<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
98+
| <<plugins-{type}s-{plugin}-max_partition_fetch_bytes>> |<<number,number>>|No
99+
| <<plugins-{type}s-{plugin}-max_poll_interval_ms>> |<<number,number>>|No
100+
| <<plugins-{type}s-{plugin}-max_poll_records>> |<<number,number>>|No
101+
| <<plugins-{type}s-{plugin}-metadata_max_age_ms>> |<<number,number>>|No
102102
| <<plugins-{type}s-{plugin}-partition_assignment_strategy>> |<<string,string>>|No
103103
| <<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
104+
| <<plugins-{type}s-{plugin}-receive_buffer_bytes>> |<<number,number>>|No
105+
| <<plugins-{type}s-{plugin}-reconnect_backoff_ms>> |<<number,number>>|No
106+
| <<plugins-{type}s-{plugin}-request_timeout_ms>> |<<number,number>>|No
107+
| <<plugins-{type}s-{plugin}-retry_backoff_ms>> |<<number,number>>|No
108108
| <<plugins-{type}s-{plugin}-sasl_kerberos_service_name>> |<<string,string>>|No
109109
| <<plugins-{type}s-{plugin}-sasl_mechanism>> |<<string,string>>|No
110110
| <<plugins-{type}s-{plugin}-security_protocol>> |<<string,string>>, one of `["PLAINTEXT", "SSL", "SASL_PLAINTEXT", "SASL_SSL"]`|No
111-
| <<plugins-{type}s-{plugin}-send_buffer_bytes>> |<<string,string>>|No
112-
| <<plugins-{type}s-{plugin}-session_timeout_ms>> |<<string,string>>|No
111+
| <<plugins-{type}s-{plugin}-send_buffer_bytes>> |<<number,number>>|No
112+
| <<plugins-{type}s-{plugin}-session_timeout_ms>> |<<number,number>>|No
113113
| <<plugins-{type}s-{plugin}-ssl_endpoint_identification_algorithm>> |<<string,string>>|No
114114
| <<plugins-{type}s-{plugin}-ssl_key_password>> |<<password,password>>|No
115115
| <<plugins-{type}s-{plugin}-ssl_keystore_location>> |a valid filesystem path|No
@@ -131,8 +131,8 @@ input plugins.
131131
[id="plugins-{type}s-{plugin}-auto_commit_interval_ms"]
132132
===== `auto_commit_interval_ms`
133133

134-
* Value type is <<string,string>>
135-
* Default value is `"5000"`
134+
* Value type is <<number,number>>
135+
* Default value is `5000`
136136

137137
The frequency in milliseconds that the consumer offsets are committed to Kafka.
138138

@@ -184,7 +184,7 @@ a logical application name to be included.
184184
[id="plugins-{type}s-{plugin}-connections_max_idle_ms"]
185185
===== `connections_max_idle_ms`
186186

187-
* Value type is <<string,string>>
187+
* Value type is <<number,number>>
188188
* There is no default value for this setting.
189189

190190
Close idle connections after the number of milliseconds specified by this config.
@@ -235,7 +235,7 @@ If set to true the only way to receive records from an internal topic is subscri
235235
[id="plugins-{type}s-{plugin}-fetch_max_bytes"]
236236
===== `fetch_max_bytes`
237237

238-
* Value type is <<string,string>>
238+
* Value type is <<number,number>>
239239
* There is no default value for this setting.
240240

241241
The maximum amount of data the server should return for a fetch request. This is not an
@@ -245,7 +245,7 @@ than this value, the message will still be returned to ensure that the consumer
245245
[id="plugins-{type}s-{plugin}-fetch_max_wait_ms"]
246246
===== `fetch_max_wait_ms`
247247

248-
* Value type is <<string,string>>
248+
* Value type is <<number,number>>
249249
* There is no default value for this setting.
250250

251251
The maximum amount of time the server will block before answering the fetch request if
@@ -255,7 +255,7 @@ should be less than or equal to the timeout used in `poll_timeout_ms`
255255
[id="plugins-{type}s-{plugin}-fetch_min_bytes"]
256256
===== `fetch_min_bytes`
257257

258-
* Value type is <<string,string>>
258+
* Value type is <<number,number>>
259259
* There is no default value for this setting.
260260

261261
The minimum amount of data the server should return for a fetch request. If insufficient
@@ -275,7 +275,7 @@ Logstash instances with the same `group_id`
275275
[id="plugins-{type}s-{plugin}-heartbeat_interval_ms"]
276276
===== `heartbeat_interval_ms`
277277

278-
* Value type is <<string,string>>
278+
* Value type is <<number,number>>
279279
* There is no default value for this setting.
280280

281281
The expected time between heartbeats to the consumer coordinator. Heartbeats are used to ensure
@@ -326,7 +326,7 @@ Java Class used to deserialize the record's key
326326
[id="plugins-{type}s-{plugin}-max_partition_fetch_bytes"]
327327
===== `max_partition_fetch_bytes`
328328

329-
* Value type is <<string,string>>
329+
* Value type is <<number,number>>
330330
* There is no default value for this setting.
331331

332332
The maximum amount of data per-partition the server will return. The maximum total memory used for a
@@ -338,7 +338,7 @@ to fetch a large message on a certain partition.
338338
[id="plugins-{type}s-{plugin}-max_poll_interval_ms"]
339339
===== `max_poll_interval_ms`
340340

341-
* Value type is <<string,string>>
341+
* Value type is <<number,number>>
342342
* There is no default value for this setting.
343343

344344
The maximum delay between invocations of poll() when using consumer group management. This places
@@ -350,15 +350,15 @@ The value of the configuration `request_timeout_ms` must always be larger than m
350350
[id="plugins-{type}s-{plugin}-max_poll_records"]
351351
===== `max_poll_records`
352352

353-
* Value type is <<string,string>>
353+
* Value type is <<number,number>>
354354
* There is no default value for this setting.
355355

356356
The maximum number of records returned in a single call to poll().
357357

358358
[id="plugins-{type}s-{plugin}-metadata_max_age_ms"]
359359
===== `metadata_max_age_ms`
360360

361-
* Value type is <<string,string>>
361+
* Value type is <<number,number>>
362362
* There is no default value for this setting.
363363

364364
The period of time in milliseconds after which we force a refresh of metadata even if
@@ -386,15 +386,15 @@ Time kafka consumer will wait to receive new messages from topics
386386
[id="plugins-{type}s-{plugin}-receive_buffer_bytes"]
387387
===== `receive_buffer_bytes`
388388

389-
* Value type is <<string,string>>
389+
* Value type is <<number,number>>
390390
* There is no default value for this setting.
391391

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

394394
[id="plugins-{type}s-{plugin}-reconnect_backoff_ms"]
395395
===== `reconnect_backoff_ms`
396396

397-
* Value type is <<string,string>>
397+
* Value type is <<number,number>>
398398
* There is no default value for this setting.
399399

400400
The amount of time to wait before attempting to reconnect to a given host.
@@ -404,7 +404,7 @@ This backoff applies to all requests sent by the consumer to the broker.
404404
[id="plugins-{type}s-{plugin}-request_timeout_ms"]
405405
===== `request_timeout_ms`
406406

407-
* Value type is <<string,string>>
407+
* Value type is <<number,number>>
408408
* There is no default value for this setting.
409409

410410
The configuration controls the maximum amount of time the client will wait
@@ -415,7 +415,7 @@ retries are exhausted.
415415
[id="plugins-{type}s-{plugin}-retry_backoff_ms"]
416416
===== `retry_backoff_ms`
417417

418-
* Value type is <<string,string>>
418+
* Value type is <<number,number>>
419419
* There is no default value for this setting.
420420

421421
The amount of time to wait before attempting to retry a failed fetch request
@@ -451,15 +451,15 @@ Security protocol to use, which can be either of PLAINTEXT,SSL,SASL_PLAINTEXT,SA
451451
[id="plugins-{type}s-{plugin}-send_buffer_bytes"]
452452
===== `send_buffer_bytes`
453453

454-
* Value type is <<string,string>>
454+
* Value type is <<number,number>>
455455
* There is no default value for this setting.
456456

457457
The size of the TCP send buffer (SO_SNDBUF) to use when sending data
458458

459459
[id="plugins-{type}s-{plugin}-session_timeout_ms"]
460460
===== `session_timeout_ms`
461461

462-
* Value type is <<string,string>>
462+
* Value type is <<number,number>>
463463
* There is no default value for this setting.
464464

465465
The timeout after which, if the `poll_timeout_ms` is not invoked, the consumer is marked dead

lib/logstash/inputs/kafka.rb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class LogStash::Inputs::Kafka < LogStash::Inputs::Base
5353
default :codec, 'plain'
5454

5555
# The frequency in milliseconds that the consumer offsets are committed to Kafka.
56-
config :auto_commit_interval_ms, :validate => :string, :default => "5000"
56+
config :auto_commit_interval_ms, :validate => :number, :default => 5000
5757
# What to do when there is no initial offset in Kafka or if an offset is out of range:
5858
#
5959
# * earliest: automatically reset the offset to the earliest offset
@@ -76,7 +76,7 @@ class LogStash::Inputs::Kafka < LogStash::Inputs::Base
7676
# a logical application name to be included.
7777
config :client_id, :validate => :string, :default => "logstash"
7878
# Close idle connections after the number of milliseconds specified by this config.
79-
config :connections_max_idle_ms, :validate => :string
79+
config :connections_max_idle_ms, :validate => :number
8080
# Ideally you should have as many threads as the number of partitions for a perfect
8181
# balance — more threads than partitions means that some threads will be idle
8282
config :consumer_threads, :validate => :number, :default => 1
@@ -90,15 +90,15 @@ class LogStash::Inputs::Kafka < LogStash::Inputs::Base
9090
# The maximum amount of data the server should return for a fetch request. This is not an
9191
# absolute maximum, if the first message in the first non-empty partition of the fetch is larger
9292
# than this value, the message will still be returned to ensure that the consumer can make progress.
93-
config :fetch_max_bytes, :validate => :string
93+
config :fetch_max_bytes, :validate => :number
9494
# The maximum amount of time the server will block before answering the fetch request if
9595
# there isn't sufficient data to immediately satisfy `fetch_min_bytes`. This
9696
# should be less than or equal to the timeout used in `poll_timeout_ms`
97-
config :fetch_max_wait_ms, :validate => :string
97+
config :fetch_max_wait_ms, :validate => :number
9898
# The minimum amount of data the server should return for a fetch request. If insufficient
9999
# data is available the request will wait for that much data to accumulate
100100
# before answering the request.
101-
config :fetch_min_bytes, :validate => :string
101+
config :fetch_min_bytes, :validate => :number
102102
# The identifier of the group this consumer belongs to. Consumer group is a single logical subscriber
103103
# that happens to be made up of multiple processors. Messages in a topic will be distributed to all
104104
# Logstash instances with the same `group_id`
@@ -108,48 +108,48 @@ class LogStash::Inputs::Kafka < LogStash::Inputs::Base
108108
# consumers join or leave the group. The value must be set lower than
109109
# `session.timeout.ms`, but typically should be set no higher than 1/3 of that value.
110110
# It can be adjusted even lower to control the expected time for normal rebalances.
111-
config :heartbeat_interval_ms, :validate => :string
111+
config :heartbeat_interval_ms, :validate => :number
112112
# Java Class used to deserialize the record's key
113113
config :key_deserializer_class, :validate => :string, :default => "org.apache.kafka.common.serialization.StringDeserializer"
114114
# The maximum delay between invocations of poll() when using consumer group management. This places
115115
# an upper bound on the amount of time that the consumer can be idle before fetching more records.
116116
# If poll() is not called before expiration of this timeout, then the consumer is considered failed and
117117
# the group will rebalance in order to reassign the partitions to another member.
118118
# The value of the configuration `request_timeout_ms` must always be larger than max_poll_interval_ms
119-
config :max_poll_interval_ms, :validate => :string
119+
config :max_poll_interval_ms, :validate => :number
120120
# The maximum amount of data per-partition the server will return. The maximum total memory used for a
121121
# request will be <code>#partitions * max.partition.fetch.bytes</code>. This size must be at least
122122
# as large as the maximum message size the server allows or else it is possible for the producer to
123123
# send messages larger than the consumer can fetch. If that happens, the consumer can get stuck trying
124124
# to fetch a large message on a certain partition.
125-
config :max_partition_fetch_bytes, :validate => :string
125+
config :max_partition_fetch_bytes, :validate => :number
126126
# The maximum number of records returned in a single call to poll().
127-
config :max_poll_records, :validate => :string
127+
config :max_poll_records, :validate => :number
128128
# The period of time in milliseconds after which we force a refresh of metadata even if
129129
# we haven't seen any partition leadership changes to proactively discover any new brokers or partitions
130-
config :metadata_max_age_ms, :validate => :string
130+
config :metadata_max_age_ms, :validate => :number
131131
# The class name of the partition assignment strategy that the client will use to distribute
132132
# partition ownership amongst consumer instances
133133
config :partition_assignment_strategy, :validate => :string
134134
# The size of the TCP receive buffer (SO_RCVBUF) to use when reading data.
135-
config :receive_buffer_bytes, :validate => :string
135+
config :receive_buffer_bytes, :validate => :number
136136
# The amount of time to wait before attempting to reconnect to a given host.
137137
# This avoids repeatedly connecting to a host in a tight loop.
138138
# This backoff applies to all requests sent by the consumer to the broker.
139-
config :reconnect_backoff_ms, :validate => :string
139+
config :reconnect_backoff_ms, :validate => :number
140140
# The configuration controls the maximum amount of time the client will wait
141141
# for the response of a request. If the response is not received before the timeout
142142
# elapses the client will resend the request if necessary or fail the request if
143143
# retries are exhausted.
144-
config :request_timeout_ms, :validate => :string
144+
config :request_timeout_ms, :validate => :number
145145
# The amount of time to wait before attempting to retry a failed fetch request
146146
# to a given topic partition. This avoids repeated fetching-and-failing in a tight loop.
147-
config :retry_backoff_ms, :validate => :string
147+
config :retry_backoff_ms, :validate => :number
148148
# The size of the TCP send buffer (SO_SNDBUF) to use when sending data
149-
config :send_buffer_bytes, :validate => :string
149+
config :send_buffer_bytes, :validate => :number
150150
# The timeout after which, if the `poll_timeout_ms` is not invoked, the consumer is marked dead
151151
# and a rebalance operation is triggered for the group identified by `group_id`
152-
config :session_timeout_ms, :validate => :string
152+
config :session_timeout_ms, :validate => :number
153153
# Java Class used to deserialize the record's value
154154
config :value_deserializer_class, :validate => :string, :default => "org.apache.kafka.common.serialization.StringDeserializer"
155155
# A list of topics to subscribe to, defaults to ["logstash"].

logstash-input-kafka.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |s|
22
s.name = 'logstash-input-kafka'
3-
s.version = '9.0.0'
3+
s.version = '10.0.0'
44
s.licenses = ['Apache-2.0']
55
s.summary = "Reads events from a Kafka topic"
66
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"

0 commit comments

Comments
 (0)