From 77b5a708bfc8f32be03dc1a3f5ed548a28ba40fc Mon Sep 17 00:00:00 2001 From: Dugong Date: Fri, 3 Jan 2025 11:11:43 +0000 Subject: [PATCH] adapt to connect retry mechanism --- .../kafbat/ui/client/RetryingKafkaConnectClient.java | 6 ++++++ .../java/io/kafbat/ui/KafkaConnectServiceTests.java | 12 +----------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/api/src/main/java/io/kafbat/ui/client/RetryingKafkaConnectClient.java b/api/src/main/java/io/kafbat/ui/client/RetryingKafkaConnectClient.java index 0f2185bf2..18b60aa6c 100644 --- a/api/src/main/java/io/kafbat/ui/client/RetryingKafkaConnectClient.java +++ b/api/src/main/java/io/kafbat/ui/client/RetryingKafkaConnectClient.java @@ -277,6 +277,12 @@ public Mono> resumeConnectorWithHttpInfo(String connectorNa return withRetryOnConflictOrRebalance(super.resumeConnectorWithHttpInfo(connectorName)); } + @Override + public Mono> resetConnectorOffsets(String connectorName) + throws WebClientResponseException { + return withRetryOnConflictOrRebalance(super.resetConnectorOffsets(connectorName)); + } + @Override public Mono> setConnectorConfigWithHttpInfo(String connectorName, Map requestBody) diff --git a/api/src/test/java/io/kafbat/ui/KafkaConnectServiceTests.java b/api/src/test/java/io/kafbat/ui/KafkaConnectServiceTests.java index 1415f8d69..b12d5e78b 100644 --- a/api/src/test/java/io/kafbat/ui/KafkaConnectServiceTests.java +++ b/api/src/test/java/io/kafbat/ui/KafkaConnectServiceTests.java @@ -59,20 +59,10 @@ public void setUp() { "file", "/tmp/test", "test.password", "test-credentials"))) .exchange() + .expectStatus().isOk() .expectBody() .returnResult(); - webTestClient.get() - .uri("/api/clusters/{clusterName}/connects/{connectName}/connectors/{connectorName}", - LOCAL, connectName, connectorName) - .exchange() - .expectStatus().isOk(); - - // Kafka Connect may return transient HTTP 500 errors during rebalances - if (creationResult.getStatus() != HttpStatus.OK) { - log.warn( - "Ignoring a transient error while setting up the tested connector, because it has been created anyway."); - } } @AfterEach