瀏覽代碼

Upgrade Spring Boot to 2.5.6

* #931: upgrade Spring Boot to 2.5.6

* #931: add spring-boot-starter-validation dependency
Si Tang 3 年之前
父節點
當前提交
7bd3fdd152

+ 3 - 7
kafka-ui-api/src/main/java/com/provectus/kafka/ui/client/RetryingKafkaConnectClient.java

@@ -18,7 +18,7 @@ import org.springframework.web.client.RestClientException;
 import org.springframework.web.reactive.function.client.WebClientResponseException;
 import reactor.core.publisher.Flux;
 import reactor.core.publisher.Mono;
-import reactor.retry.Retry;
+import reactor.util.retry.Retry;
 
 @Log4j2
 public class RetryingKafkaConnectClient extends KafkaConnectClientApi {
@@ -30,9 +30,7 @@ public class RetryingKafkaConnectClient extends KafkaConnectClientApi {
 
   private static <T> Mono<T> withRetryOnConflict(Mono<T> publisher) {
     return publisher.retryWhen(
-        Retry.onlyIf(e -> e.exception() instanceof WebClientResponseException.Conflict)
-            .retryMax(MAX_RETRIES)
-    )
+            Retry.max(MAX_RETRIES).filter(e -> e instanceof WebClientResponseException.Conflict))
         .onErrorResume(WebClientResponseException.Conflict.class,
             e -> Mono.error(new RebalanceInProgressException()))
         .doOnError(log::error);
@@ -40,9 +38,7 @@ public class RetryingKafkaConnectClient extends KafkaConnectClientApi {
 
   private static <T> Flux<T> withRetryOnConflict(Flux<T> publisher) {
     return publisher.retryWhen(
-        Retry.onlyIf(e -> e.exception() instanceof WebClientResponseException.Conflict)
-            .retryMax(MAX_RETRIES)
-    )
+            Retry.max(MAX_RETRIES).filter(e -> e instanceof WebClientResponseException.Conflict))
         .onErrorResume(WebClientResponseException.Conflict.class,
             e -> Mono.error(new RebalanceInProgressException()))
         .doOnError(log::error);

+ 5 - 0
kafka-ui-contract/pom.xml

@@ -23,6 +23,11 @@
                     <artifactId>spring-boot-starter-webflux</artifactId>
                     <version>${spring-boot.version}</version>
                 </dependency>
+                <dependency>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-validation</artifactId>
+                    <version>${spring-boot.version}</version>
+                </dependency>
                 <dependency>
                     <groupId>io.swagger</groupId>
                     <artifactId>swagger-annotations</artifactId>

+ 1 - 1
pom.xml

@@ -14,7 +14,7 @@
         <maven.compiler.target>13</maven.compiler.target>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 
-        <spring-boot.version>2.2.4.RELEASE</spring-boot.version>
+        <spring-boot.version>2.5.6</spring-boot.version>
         <jackson-databind-nullable.version>0.2.1</jackson-databind-nullable.version>
         <org.mapstruct.version>1.4.2.Final</org.mapstruct.version>
         <org.projectlombok.version>1.18.20</org.projectlombok.version>