From a998133d2a24636f5fcc5983d323e90a5716557b Mon Sep 17 00:00:00 2001 From: Chris Phillipson Date: Tue, 10 Dec 2019 07:36:06 -0800 Subject: [PATCH] Bring build.w-mysql.gradle into parity with build.gradle w.r.t. to managed version dependencies * Fix issue with H2 by updating version to r2dbc-h2-0.8.1.RELEASE * Adjust WebClientConfig.java as per https://github.com/spring-projects/spring-framework/issues/23961#issuecomment-552214198 and increase spring.codec.max-in-memory-size property value in application.yml to 512000000 * Adjust SpaceUsersTask.java to flatMap on save --- README.md | 4 ---- build.w-mysql.gradle | 18 +++++++++--------- .../pivotal/cfapp/config/WebClientConfig.java | 10 ++++------ .../io/pivotal/cfapp/task/SpaceUsersTask.java | 2 +- src/main/resources/application.yml | 2 ++ 5 files changed, 16 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index a79727bf..f4d67b08 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,6 @@ Reaching out to each development team to tell them to clean-up has become a chor This is where `cf-butler` has your back. -# Announcements - -* 2019-12-09 H2 support on master is currently in broken state and depends on this [issue](https://github.com/r2dbc/r2dbc-h2/issues/129) being addressed. - # Table of Contents * [What does it do?](#what-does-it-do) diff --git a/build.w-mysql.gradle b/build.w-mysql.gradle index cea7a69d..78bb7941 100644 --- a/build.w-mysql.gradle +++ b/build.w-mysql.gradle @@ -1,14 +1,14 @@ plugins { id 'com.gorylenko.gradle-git-properties' version '2.2.0' - id 'org.springframework.boot' version '2.2.1.RELEASE' + id 'org.springframework.boot' version '2.2.2.RELEASE' id 'io.spring.dependency-management' version '1.0.8.RELEASE' - id 'com.github.ben-manes.versions' version '0.26.0' + id 'com.github.ben-manes.versions' version '0.27.0' id 'io.franzbecker.gradle-lombok' version '3.2.0' id 'java' id 'jacoco' id 'com.google.cloud.tools.jib' version '1.8.0' id 'maven-publish' - id 'com.github.spotbugs' version '2.0.1' + id 'com.github.spotbugs' version '3.0.0' id 'info.solidsoft.pitest' version '1.4.5' } @@ -132,7 +132,7 @@ dependencies { implementation('org.locationtech.jts:jts-core:1.16.1') implementation('io.r2dbc:r2dbc-spi:0.8.0.RELEASE') runtime('io.r2dbc:r2dbc-pool:0.8.0.RELEASE') - implementation('io.r2dbc:r2dbc-h2:0.8.0.RELEASE') + implementation('io.r2dbc:r2dbc-h2:0.8.1.RELEASE') runtime('com.github.mirromutth:r2dbc-mysql:v0.8.0.RELEASE') implementation('org.eclipse.jgit:org.eclipse.jgit:5.5.0.201909110433-r') implementation('org.springframework.boot:spring-boot-starter-mail') @@ -140,15 +140,15 @@ dependencies { exclude group: 'org.apache.httpcomponents', module: 'httpclient' } implementation('org.apache.httpcomponents:httpclient:4.5.10') - implementation('org.cloudfoundry:cloudfoundry-client-reactor:4.0.1.RELEASE') - implementation('org.cloudfoundry:cloudfoundry-operations:4.0.1.RELEASE') - implementation('io.projectreactor:reactor-core:3.3.0.RELEASE') + implementation('org.cloudfoundry:cloudfoundry-client-reactor:4.2.0.RELEASE') + implementation('org.cloudfoundry:cloudfoundry-operations:4.2.0.RELEASE') + implementation('io.projectreactor:reactor-core:3.3.1.RELEASE') //implementation('io.projectreactor:reactor-tools:3.3.0.RELEASE') //implementation('io.projectreactor.tools:blockhound:1.0.0.RELEASE') - implementation('io.projectreactor.netty:reactor-netty:0.9.0.RELEASE') + implementation('io.projectreactor.netty:reactor-netty:0.9.2.RELEASE') implementation('io.micrometer:micrometer-registry-prometheus') testImplementation('io.projectreactor:reactor-test') - testImplementation('org.assertj:assertj-core:3.13.2') + testImplementation('org.assertj:assertj-core:3.14.0') testImplementation('org.junit.jupiter:junit-jupiter-api') testImplementation('org.junit.jupiter:junit-jupiter-params') testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine') diff --git a/src/main/java/io/pivotal/cfapp/config/WebClientConfig.java b/src/main/java/io/pivotal/cfapp/config/WebClientConfig.java index 13ca54cc..e17ce0c4 100644 --- a/src/main/java/io/pivotal/cfapp/config/WebClientConfig.java +++ b/src/main/java/io/pivotal/cfapp/config/WebClientConfig.java @@ -21,7 +21,7 @@ public class WebClientConfig { @Bean @ConditionalOnProperty(name = "cf.sslValidationSkipped", havingValue="true") - public WebClient insecureWebClient() throws SSLException { + public WebClient insecureWebClient(WebClient.Builder builder) throws SSLException { SslContext sslContext = SslContextBuilder .forClient() @@ -29,17 +29,15 @@ public WebClient insecureWebClient() throws SSLException { .build(); TcpClient tcpClient = TcpClient.create().secure(sslProviderBuilder -> sslProviderBuilder.sslContext(sslContext)); HttpClient httpClient = HttpClient.from(tcpClient); - return WebClient - .builder() + return builder .clientConnector(new ReactorClientHttpConnector(httpClient)) .build(); } @Bean @ConditionalOnProperty(name = "cf.sslValidationSkipped", havingValue="false", matchIfMissing=true) - public WebClient secureWebClient() { - return WebClient - .builder() + public WebClient secureWebClient(WebClient.Builder builder) { + return builder .build(); } } diff --git a/src/main/java/io/pivotal/cfapp/task/SpaceUsersTask.java b/src/main/java/io/pivotal/cfapp/task/SpaceUsersTask.java index 9fedcbf2..2b986c32 100644 --- a/src/main/java/io/pivotal/cfapp/task/SpaceUsersTask.java +++ b/src/main/java/io/pivotal/cfapp/task/SpaceUsersTask.java @@ -42,7 +42,7 @@ public void collect(List spaces) { .deleteAll() .thenMany(Flux.fromIterable(spaces)) .concatMap(space -> getSpaceUsers(space)) - .concatMap(service::save) + .flatMap(service::save) .thenMany(service.findAll()) .collectList() .subscribe( diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 1b51f2f4..179ae82d 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -92,6 +92,8 @@ notification: engine: none spring: + codec: + max-in-memory-size: 512000000 r2dbc: url: r2dbc:h2:mem:///cf-butler?options=DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false name: cf-butler