From c9811e4f60682dceda5b9167be593b972a677360 Mon Sep 17 00:00:00 2001 From: Ilya Kuramshin Date: Wed, 8 Dec 2021 13:23:10 +0300 Subject: [PATCH] Kafka API timeout fixes + doc (#1187) * kafka.admin-client-timeout set to 30s by default * unused zookeeper.connection-timeout removed * documentation to admin-client-timeout param added --- README.md | 9 +++++---- .../kafka/ui/service/AdminClientServiceImpl.java | 2 +- kafka-ui-api/src/main/resources/application-local.yml | 3 --- kafka-ui-api/src/main/resources/application-sdp.yml | 3 --- kafka-ui-api/src/main/resources/application.yml | 6 +----- kafka-ui-api/src/test/resources/application-test.yml | 3 --- 6 files changed, 7 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index dcfa9f652a..7eb9a4f585 100644 --- a/README.md +++ b/README.md @@ -162,7 +162,11 @@ For example, if you want to use an environment variable to set the `name` parame |Name |Description |-----------------------|------------------------------- -|`SERVER_SERVLET_CONTEXT_PATH` | URI basePath +|`SERVER_SERVLET_CONTEXT_PATH` | URI basePath +|`LOGGING_LEVEL_ROOT` | Setting log level (trace, debug, info, warn, error, fatal, off). Default: debug +|`LOGGING_LEVEL_COM_PROVECTUS` |Setting log level (trace, debug, info, warn, error, fatal, off). Default: debug +|`SERVER_PORT` |Port for the embedded server. Default: `8080` +|`KAFKA_ADMIN-CLIENT-TIMEOUT` | Kafka API timeout in ms. Default: `30000` |`KAFKA_CLUSTERS_0_NAME` | Cluster name |`KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS` |Address where to connect |`KAFKA_CLUSTERS_0_ZOOKEEPER` | Zookeeper service address @@ -177,9 +181,6 @@ For example, if you want to use an environment variable to set the `name` parame |`KAFKA_CLUSTERS_0_DISABLELOGDIRSCOLLECTION` |Disable collecting segments information. It should be true for confluent cloud. Default: false |`KAFKA_CLUSTERS_0_KAFKACONNECT_0_NAME` |Given name for the Kafka Connect cluster |`KAFKA_CLUSTERS_0_KAFKACONNECT_0_ADDRESS` |Address of the Kafka Connect service endpoint -|`LOGGING_LEVEL_ROOT` | Setting log level (trace, debug, info, warn, error, fatal, off). Default: debug -|`LOGGING_LEVEL_COM_PROVECTUS` |Setting log level (trace, debug, info, warn, error, fatal, off). Default: debug -|`SERVER_PORT` |Port for the embedded server. Default `8080` |`KAFKA_CLUSTERS_0_JMXSSL` |Enable SSL for JMX? `true` or `false`. For advanced setup, see `kafka-ui-jmx-secured.yml` |`KAFKA_CLUSTERS_0_JMXUSERNAME` |Username for JMX authentication |`KAFKA_CLUSTERS_0_JMXPASSWORD` |Password for JMX authentication diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/AdminClientServiceImpl.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/AdminClientServiceImpl.java index 88cc259b99..f92ea1e1d5 100644 --- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/AdminClientServiceImpl.java +++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/AdminClientServiceImpl.java @@ -20,7 +20,7 @@ import reactor.core.publisher.Mono; public class AdminClientServiceImpl implements AdminClientService, Closeable { private final Map adminClientCache = new ConcurrentHashMap<>(); @Setter // used in tests - @Value("${kafka.admin-client-timeout}") + @Value("${kafka.admin-client-timeout:30000}") private int clientTimeout; @Override diff --git a/kafka-ui-api/src/main/resources/application-local.yml b/kafka-ui-api/src/main/resources/application-local.yml index 93a5745c38..54bdb59f5b 100644 --- a/kafka-ui-api/src/main/resources/application-local.yml +++ b/kafka-ui-api/src/main/resources/application-local.yml @@ -27,9 +27,6 @@ kafka: # protobufMessageNameByTopic: # input-topic: InputMessage # output-topic: OutputMessage - admin-client-timeout: 5000 -zookeeper: - connection-timeout: 1000 spring: jmx: enabled: true diff --git a/kafka-ui-api/src/main/resources/application-sdp.yml b/kafka-ui-api/src/main/resources/application-sdp.yml index 2de30ccb7c..f8d4445fed 100644 --- a/kafka-ui-api/src/main/resources/application-sdp.yml +++ b/kafka-ui-api/src/main/resources/application-sdp.yml @@ -11,6 +11,3 @@ kafka: # zookeeper: zookeeper1:2181 # bootstrapServers: kafka1:29092 # schemaRegistry: http://schemaregistry1:8085 - admin-client-timeout: 5000 -zookeeper: - connection-timeout: 1000 diff --git a/kafka-ui-api/src/main/resources/application.yml b/kafka-ui-api/src/main/resources/application.yml index 2cda55ac2a..54d4c09011 100644 --- a/kafka-ui-api/src/main/resources/application.yml +++ b/kafka-ui-api/src/main/resources/application.yml @@ -1,7 +1,3 @@ -kafka: - admin-client-timeout: 5000 -zookeeper: - connection-timeout: 1000 auth: enabled: false management: @@ -13,4 +9,4 @@ management: endpoints: web: exposure: - include: "info,health" + include: "info,health" \ No newline at end of file diff --git a/kafka-ui-api/src/test/resources/application-test.yml b/kafka-ui-api/src/test/resources/application-test.yml index ec67d666a0..63dada6723 100644 --- a/kafka-ui-api/src/test/resources/application-test.yml +++ b/kafka-ui-api/src/test/resources/application-test.yml @@ -6,9 +6,6 @@ kafka: zookeeper: localhost:2181 schemaRegistry: http://localhost:8081 jmxPort: 9997 - admin-client-timeout: 5000 -zookeeper: - connection-timeout: 1000 spring: jmx: enabled: true