Skip to content

Commit 689b00c

Browse files
authored
Merge pull request #1238 from bosch-io/improve-kafka-client-configuration
Allow to configure connection.max.idle.ms via environment variable
2 parents 29a00db + 8094d1c commit 689b00c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

connectivity/service/src/main/resources/connectivity.conf

+10-2
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,12 @@ ditto {
406406
# can be defined in this configuration section.
407407
kafka-clients {
408408
enable.auto.commit = true
409-
fetch.max.wait.ms = 5000
409+
fetch.max.wait.ms = 2500
410410
fetch.max.wait.ms = ${?KAFKA_CONSUMER_FETCH_MAX_WAIT_MS}
411+
metadata.max.age.ms = 180000
412+
metadata.max.age.ms = ${?KAFKA_CONNECTION_MAX_IDLE_MS}
413+
connections.max.idle.ms = 180000
414+
connections.max.idle.ms = ${?KAFKA_CONNECTION_MAX_IDLE_MS}
411415
}
412416
}
413417
metric-collecting-interval = 10s
@@ -464,7 +468,11 @@ ditto {
464468
# Close idle connections after the number of milliseconds specified by this config.
465469
# When a message should be produced after a connection was closed because of this timeout, the client
466470
# simply opens the connection again, so for producers there is no need to increase this value:
467-
connections.max.idle.ms = 540000 # default: 540000 (9min)
471+
connections.max.idle.ms = 180000
472+
connections.max.idle.ms = ${?KAFKA_CONNECTION_MAX_IDLE_MS}
473+
474+
metadata.max.age.ms = 180000
475+
metadata.max.age.ms = ${?KAFKA_CONNECTION_MAX_IDLE_MS}
468476

469477
# The maximum amount of time in milliseconds to wait when reconnecting to a broker that has repeatedly failed to connect.
470478
# If provided, the backoff per host will increase exponentially for each consecutive connection failure, up to this maximum.

0 commit comments

Comments
 (0)