Skip to content

Commit

Permalink
Bring build.w-mysql.gradle into parity with build.gradle w.r.t. to ma…
Browse files Browse the repository at this point in the history
…naged version dependencies

* Fix issue with H2 by updating version to r2dbc-h2-0.8.1.RELEASE
* Adjust WebClientConfig.java as per spring-projects/spring-framework#23961 (comment) and increase spring.codec.max-in-memory-size property value in application.yml to 512000000
* Adjust SpaceUsersTask.java to flatMap on save
  • Loading branch information
pacphi committed Dec 10, 2019
1 parent 59bd3d9 commit a998133
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 20 deletions.
4 changes: 0 additions & 4 deletions README.md
Expand Up @@ -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)
Expand Down
18 changes: 9 additions & 9 deletions 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'
}

Expand Down Expand Up @@ -132,23 +132,23 @@ 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')
implementation('com.sendgrid:sendgrid-java:4.4.1') {
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')
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/io/pivotal/cfapp/config/WebClientConfig.java
Expand Up @@ -21,25 +21,23 @@ 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()
.trustManager(InsecureTrustManagerFactory.INSTANCE)
.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();
}
}
2 changes: 1 addition & 1 deletion src/main/java/io/pivotal/cfapp/task/SpaceUsersTask.java
Expand Up @@ -42,7 +42,7 @@ public void collect(List<Space> spaces) {
.deleteAll()
.thenMany(Flux.fromIterable(spaces))
.concatMap(space -> getSpaceUsers(space))
.concatMap(service::save)
.flatMap(service::save)
.thenMany(service.findAll())
.collectList()
.subscribe(
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/application.yml
Expand Up @@ -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
Expand Down

0 comments on commit a998133

Please sign in to comment.