Upgrade Spring Boot to 2.5.6

* #931: upgrade Spring Boot to 2.5.6

* #931: add spring-boot-starter-validation dependency
This commit is contained in:
Si Tang 2021-10-26 20:38:25 +09:00 committed by GitHub
parent 83fba5aca3
commit 7bd3fdd152
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 8 deletions

View file

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

View file

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

View file

@ -14,7 +14,7 @@
<maven.compiler.target>13</maven.compiler.target> <maven.compiler.target>13</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <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> <jackson-databind-nullable.version>0.2.1</jackson-databind-nullable.version>
<org.mapstruct.version>1.4.2.Final</org.mapstruct.version> <org.mapstruct.version>1.4.2.Final</org.mapstruct.version>
<org.projectlombok.version>1.18.20</org.projectlombok.version> <org.projectlombok.version>1.18.20</org.projectlombok.version>