From beb64c6e521d3516d5c502df19e33c0471f622b0 Mon Sep 17 00:00:00 2001 From: Lionel Montrieux Date: Tue, 9 May 2017 12:16:10 +0200 Subject: [PATCH 01/17] aruha-778 Set login, connection, and socket timeouts for postgres Set timeouts for postgres, to avoid connections hanging forever if Postgres is restarted. All three timeouts are set to 2 seconds. Here is the relevant section from the postgres jdbc documentation: loginTimeout = int Specify how long to wait for establishment of a database connection. The timeout is specified in seconds. connectTimeout = int The timeout value used for socket connect operations. If connecting to the server takes longer than this value, the connection is broken. The timeout is specified in seconds and a value of zero means that it is disabled. socketTimeout = int The timeout value used for socket read operations. If reading from the server takes longer than this value, the connection is closed. This can be used as both a brute force global query timeout and a method of detecting network problems. The timeout is specified in seconds and a value of zero means that it is disabled. --- src/main/resources/application.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index f86cd68c84..ed5f778f74 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -27,6 +27,9 @@ spring: testWhileIdle: true timeBetweenEvictionRunsMillis: 5000 minEvictableIdleTimeMillis: 60000 + socketTimeout: 2 + loginTimeout: 2 + connectTimeout: 2 hystrix.command.default.execution.isolation.strategy: SEMAPHORE hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 15000 From 33a7ddec009e561d56a8b6d855b21744a4b3b1b3 Mon Sep 17 00:00:00 2001 From: Lionel Montrieux Date: Wed, 10 May 2017 13:45:12 +0200 Subject: [PATCH 02/17] aruha-778 Use connectionProperties --- src/main/resources/application.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index ed5f778f74..ab81e5478b 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -27,9 +27,7 @@ spring: testWhileIdle: true timeBetweenEvictionRunsMillis: 5000 minEvictableIdleTimeMillis: 60000 - socketTimeout: 2 - loginTimeout: 2 - connectTimeout: 2 + connectionProperties: socketTimeout=2;connectTimeout=2;loginTimeout=2 hystrix.command.default.execution.isolation.strategy: SEMAPHORE hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 15000 From 7305efef6c33db901b801fef3e982d5461048e83 Mon Sep 17 00:00:00 2001 From: Lionel Montrieux Date: Mon, 15 May 2017 10:49:10 +0200 Subject: [PATCH 03/17] aruha-778 Connections parameters in jdbc url --- src/main/resources/application.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index ab81e5478b..07de65a3b7 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -14,7 +14,7 @@ logging: org.zalando.nakadi.config: INFO spring: datasource: - url: jdbc:postgresql://localhost:5432/local_nakadi_db + url: jdbc:postgresql://localhost:5432/local_nakadi_db?socketTimeout=2;connectTimeout=2;loginTimeout=2 username: nakadi password: nakadi driverClassName: org.postgresql.Driver From a00bac8306763188a0c1d6b5e31759712ed8b738 Mon Sep 17 00:00:00 2001 From: Lionel Montrieux Date: Tue, 16 May 2017 16:28:04 +0200 Subject: [PATCH 04/17] aruha-778 Update spring --- build.gradle | 16 +++++++------ .../java/org/zalando/nakadi/Application.java | 2 ++ .../zalando/nakadi/config/MetricsConfig.java | 2 +- .../org/zalando/nakadi/config/WebConfig.java | 2 +- src/main/resources/application.yml | 23 ++++++++++--------- .../nakadi/security/AuthenticationTest.java | 7 +++--- 6 files changed, 28 insertions(+), 24 deletions(-) diff --git a/build.gradle b/build.gradle index 14b2ac4911..fed5969b4b 100644 --- a/build.gradle +++ b/build.gradle @@ -100,13 +100,14 @@ dependencies { pgsql 'org.postgresql:postgresql:9.4.1207' // spring - compile('org.springframework.boot:spring-boot-starter-web:1.3.1.RELEASE') { + compile('org.springframework.boot:spring-boot-starter-web:1.5.3.RELEASE') { exclude module: 'logback-classic' exclude module: 'log4j-over-slf4j' } - compile 'org.springframework:spring-context:4.2.0.RELEASE' - compile 'org.springframework:spring-web:4.2.0.RELEASE' - compile 'org.springframework:spring-webmvc:4.2.0.RELEASE' + compile 'org.springframework:spring-context:4.3.8.RELEASE' + compile 'org.springframework:spring-web:4.3.8.RELEASE' + compile 'org.springframework:spring-webmvc:4.3.8.RELEASE' + compile 'org.springframework.boot:spring-boot-test:1.5.3.RELEASE' // oauth compile 'org.springframework.security.oauth:spring-security-oauth2:2.0.8.RELEASE' @@ -115,11 +116,11 @@ dependencies { } // actuator - compile 'org.springframework.boot:spring-boot-starter-actuator:1.3.1.RELEASE' + compile 'org.springframework.boot:spring-boot-starter-actuator:1.5.3.RELEASE' compile 'org.zalando.zmon:zmon-actuator:0.9.3' // storage - compile 'org.springframework.boot:spring-boot-starter-jdbc:1.3.1.RELEASE' + compile 'org.springframework.boot:spring-boot-starter-jdbc:1.5.3.RELEASE' compile 'org.postgresql:postgresql:9.4.1207' compile 'org.springframework.cloud:spring-cloud-starter-hystrix:1.1.3.RELEASE' @@ -165,7 +166,8 @@ dependencies { testCompile('junit:junit:4.12') { exclude module: "hamcrest-core" } - testCompile 'org.springframework:spring-test:4.3.2.RELEASE' + testCompile 'org.springframework:spring-test:4.3.8.RELEASE' + testCompile 'org.springframework.boot:spring-boot-test' testCompile 'org.springframework.boot:spring-boot-starter-test' testCompile 'org.skyscreamer:jsonassert:1.3.0' testCompile 'uk.co.datumedge:hamcrest-json:0.2' diff --git a/src/main/java/org/zalando/nakadi/Application.java b/src/main/java/org/zalando/nakadi/Application.java index 376fd2c054..4d059bbc70 100644 --- a/src/main/java/org/zalando/nakadi/Application.java +++ b/src/main/java/org/zalando/nakadi/Application.java @@ -2,8 +2,10 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; @SpringBootApplication +@ComponentScan(basePackages = {"org.zalando.nakadi", "org.zalando.nakadi.config"}) public class Application { public static void main(final String[] args) { diff --git a/src/main/java/org/zalando/nakadi/config/MetricsConfig.java b/src/main/java/org/zalando/nakadi/config/MetricsConfig.java index bdcb67725b..690c6f2491 100644 --- a/src/main/java/org/zalando/nakadi/config/MetricsConfig.java +++ b/src/main/java/org/zalando/nakadi/config/MetricsConfig.java @@ -9,7 +9,7 @@ import com.ryantenney.metrics.spring.config.annotation.EnableMetrics; import com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerAdapter; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.boot.context.embedded.ServletRegistrationBean; +import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/src/main/java/org/zalando/nakadi/config/WebConfig.java b/src/main/java/org/zalando/nakadi/config/WebConfig.java index f85096f7f7..5fec1d752b 100644 --- a/src/main/java/org/zalando/nakadi/config/WebConfig.java +++ b/src/main/java/org/zalando/nakadi/config/WebConfig.java @@ -3,7 +3,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.context.embedded.FilterRegistrationBean; +import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.Ordered; diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 07de65a3b7..c66fb7d33b 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -14,20 +14,21 @@ logging: org.zalando.nakadi.config: INFO spring: datasource: - url: jdbc:postgresql://localhost:5432/local_nakadi_db?socketTimeout=2;connectTimeout=2;loginTimeout=2 + url: jdbc:postgresql://localhost:5432/local_nakadi_db username: nakadi password: nakadi driverClassName: org.postgresql.Driver - initialSize: 2 - maxActive: 2 - minIdle: 1 - maxIdle: 1 - testOnBorrow: true - validationQuery: SELECT 1 - testWhileIdle: true - timeBetweenEvictionRunsMillis: 5000 - minEvictableIdleTimeMillis: 60000 - connectionProperties: socketTimeout=2;connectTimeout=2;loginTimeout=2 + tomcat: + initial-size: 2 + max-active: 2 + min-idle: 1 + max-idle: 1 + test-on-borrow: true + validation-query: SELECT 1 + test-while-idle: true + time-between-eviction-runs-millis: 5000 + min-evictable-idle-time-millis: 60000 + connection-properties: socketTimeout=2;connectTimeout=2;loginTimeout=2 hystrix.command.default.execution.isolation.strategy: SEMAPHORE hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 15000 diff --git a/src/test/java/org/zalando/nakadi/security/AuthenticationTest.java b/src/test/java/org/zalando/nakadi/security/AuthenticationTest.java index 3e9c52060a..7000827762 100644 --- a/src/test/java/org/zalando/nakadi/security/AuthenticationTest.java +++ b/src/test/java/org/zalando/nakadi/security/AuthenticationTest.java @@ -10,8 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.test.SpringApplicationConfiguration; -import org.springframework.boot.test.WebIntegrationTest; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; @@ -70,8 +70,7 @@ import static org.zalando.nakadi.utils.TestUtils.randomUUID; @RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(Application.class) -@WebIntegrationTest(randomPort = true) +@SpringBootTest(classes=Application.class, webEnvironment= WebEnvironment.RANDOM_PORT) @DirtiesContext(classMode = AFTER_CLASS) @ActiveProfiles("test") public abstract class AuthenticationTest { From 7969c23d2d4faef99ed7d2b776482278a21ec7a9 Mon Sep 17 00:00:00 2001 From: Lionel Montrieux Date: Tue, 16 May 2017 16:54:10 +0200 Subject: [PATCH 05/17] aruha-778 Remove redundant entries --- build.gradle | 2 -- 1 file changed, 2 deletions(-) diff --git a/build.gradle b/build.gradle index fed5969b4b..e8df5843c5 100644 --- a/build.gradle +++ b/build.gradle @@ -141,8 +141,6 @@ dependencies { compile "io.dropwizard.metrics:metrics-servlets:$dropwizardVersion" compile "io.dropwizard.metrics:metrics-jvm:$dropwizardVersion" compile 'org.apache.commons:commons-lang3:3.4' - compile 'org.zalando:problem-spring-web:0.5.0' - compile 'org.zalando:jackson-datatype-problem:0.5.0' compile 'org.zalando:nakadi-plugin-api:1.0.5' compile 'org.echocat.jomon:runtime:1.6.2' From decb63f6c7f354b48a756894929c569f1af6a5cd Mon Sep 17 00:00:00 2001 From: Lionel Montrieux Date: Tue, 16 May 2017 17:17:13 +0200 Subject: [PATCH 06/17] aruha-778 Fix tests --- .../nakadi/webservice/EventStreamReadingAT.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/acceptance-test/java/org/zalando/nakadi/webservice/EventStreamReadingAT.java b/src/acceptance-test/java/org/zalando/nakadi/webservice/EventStreamReadingAT.java index 6a9469ef70..ac222cc39b 100644 --- a/src/acceptance-test/java/org/zalando/nakadi/webservice/EventStreamReadingAT.java +++ b/src/acceptance-test/java/org/zalando/nakadi/webservice/EventStreamReadingAT.java @@ -252,7 +252,7 @@ public void whenGetEventsWithUknownTopicThenTopicNotFound() { .then() .statusCode(HttpStatus.NOT_FOUND.value()) .and() - .contentType(equalTo("application/problem+json;charset=UTF-8")) + .contentType(equalTo("application/problem+json")) .and() .body("detail", equalTo("topic not found")); } @@ -267,7 +267,7 @@ public void whenStreamLimitLowerThanBatchLimitThenUnprocessableEntity() { .then() .statusCode(HttpStatus.UNPROCESSABLE_ENTITY.value()) .and() - .contentType(equalTo("application/problem+json;charset=UTF-8")) + .contentType(equalTo("application/problem+json")) .and() .body("detail", equalTo("stream_limit can't be lower than batch_limit")); } @@ -282,7 +282,7 @@ public void whenStreamTimeoutLowerThanBatchTimeoutThenUnprocessableEntity() { .then() .statusCode(HttpStatus.UNPROCESSABLE_ENTITY.value()) .and() - .contentType(equalTo("application/problem+json;charset=UTF-8")) + .contentType(equalTo("application/problem+json")) .and() .body("detail", equalTo("stream_timeout can't be lower than batch_flush_timeout")); } @@ -296,7 +296,7 @@ public void whenIncorrectCursorsFormatThenBadRequest() { .then() .statusCode(HttpStatus.BAD_REQUEST.value()) .and() - .contentType(equalTo("application/problem+json;charset=UTF-8")) + .contentType(equalTo("application/problem+json")) .and() .body("detail", equalTo("incorrect syntax of X-nakadi-cursors header")); } @@ -310,7 +310,7 @@ public void whenInvalidCursorsThenPreconditionFailed() { .then() .statusCode(HttpStatus.PRECONDITION_FAILED.value()) .and() - .contentType(equalTo("application/problem+json;charset=UTF-8")) + .contentType(equalTo("application/problem+json")) .and() .body("detail", equalTo("non existing partition very_wrong_partition")); } From 1b8e48345cca88a3b51e0a18e21c1df71b3140cb Mon Sep 17 00:00:00 2001 From: Lionel Montrieux Date: Wed, 17 May 2017 14:45:00 +0200 Subject: [PATCH 07/17] aruha-778 Upgrade dependencies to latest (compatible) versions Some details about the version number for the postgres driver: https://jdbc.postgresql.org/documentation/faq.html#versioning The spring-boot plugin is renamed because 'spring-boot' is deprecated Explicit version number add for org.json:json, otherwise the upgrade of spring-boot-gradle-plugin causes gradle to use an older version of org.json --- build.gradle | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/build.gradle b/build.gradle index e8df5843c5..480f8d0d8d 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ apply plugin: 'java' apply plugin: 'groovy' apply plugin: 'eclipse' apply plugin: 'application' -apply plugin: 'spring-boot' +apply plugin: 'org.springframework.boot' apply plugin: "jacoco" apply plugin: 'findbugs' apply plugin: 'checkstyle' @@ -70,7 +70,7 @@ buildscript { } dependencies { - classpath "org.springframework.boot:spring-boot-gradle-plugin:1.2.5.RELEASE" + classpath "org.springframework.boot:spring-boot-gradle-plugin:1.5.3.RELEASE" classpath 'org.yaml:snakeyaml:1.14' } } @@ -98,7 +98,7 @@ dependencies { dropwizardVersion = '3.1.2' } - pgsql 'org.postgresql:postgresql:9.4.1207' + pgsql 'org.postgresql:postgresql:42.1.1' // spring compile('org.springframework.boot:spring-boot-starter-web:1.5.3.RELEASE') { exclude module: 'logback-classic' @@ -110,24 +110,24 @@ dependencies { compile 'org.springframework.boot:spring-boot-test:1.5.3.RELEASE' // oauth - compile 'org.springframework.security.oauth:spring-security-oauth2:2.0.8.RELEASE' + compile 'org.springframework.security.oauth:spring-security-oauth2:2.1.0.RELEASE' compile('org.springframework.boot:spring-boot-starter-security') { exclude module: "logback-classic" } // actuator compile 'org.springframework.boot:spring-boot-starter-actuator:1.5.3.RELEASE' - compile 'org.zalando.zmon:zmon-actuator:0.9.3' + compile 'org.zalando.zmon:zmon-actuator:0.9.7' // storage compile 'org.springframework.boot:spring-boot-starter-jdbc:1.5.3.RELEASE' - compile 'org.postgresql:postgresql:9.4.1207' + compile 'org.postgresql:postgresql:42.1.1' - compile 'org.springframework.cloud:spring-cloud-starter-hystrix:1.1.3.RELEASE' + compile 'org.springframework.cloud:spring-cloud-starter-hystrix:1.3.0.RELEASE' // misc - compile 'org.apache.httpcomponents:httpclient:4.5.1' - compile ('org.zalando.stups:stups-spring-oauth2-server:1.0.10') { + compile 'org.apache.httpcomponents:httpclient:4.5.3' + compile ('org.zalando.stups:stups-spring-oauth2-server:1.0.18') { exclude module: "httpclient" } compile 'org.zalando:jackson-datatype-problem:0.5.0' @@ -135,29 +135,30 @@ dependencies { compile 'org.zalando:problem-spring-web:0.5.0' compile 'com.google.guava:guava:19.0' compile 'javax.ws.rs:javax.ws.rs-api:2.0.1' - compile 'org.slf4j:slf4j-log4j12:1.7.14' + compile 'org.slf4j:slf4j-log4j12:1.7.25' compile "io.dropwizard.metrics:metrics-core:$dropwizardVersion" compile "com.ryantenney.metrics:metrics-spring:$dropwizardVersion" compile "io.dropwizard.metrics:metrics-servlets:$dropwizardVersion" compile "io.dropwizard.metrics:metrics-jvm:$dropwizardVersion" - compile 'org.apache.commons:commons-lang3:3.4' + compile 'org.apache.commons:commons-lang3:3.5' compile 'org.zalando:nakadi-plugin-api:1.0.5' - compile 'org.echocat.jomon:runtime:1.6.2' + compile 'org.echocat.jomon:runtime:1.6.3' + compile 'org.json:json:20160810' // kafka & zookeeper compile 'org.apache.kafka:kafka-clients:0.9.0.1' compile 'org.apache.kafka:kafka_2.11:0.9.0.1' - compile 'org.apache.curator:curator-framework:2.11.1' - compile 'org.apache.curator:curator-recipes:2.11.1' + compile 'org.apache.curator:curator-framework:2.12.0' + compile 'org.apache.curator:curator-recipes:2.12.0' // json - compile 'org.everit.json:org.everit.json.schema:1.4.0' - compile ('com.fasterxml.jackson.datatype:jackson-datatype-json-org:2.4.0') { + compile 'org.everit.json:org.everit.json.schema:1.5.1' + compile ('com.fasterxml.jackson.datatype:jackson-datatype-json-org:2.8.8') { exclude module: "json" } - compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.4.0' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.8.8' compile 'org.zalando:twintip-spring-web:1.1.0' - compile 'com.grack:nanojson:1.1' + compile 'com.grack:nanojson:1.2' // tests testCompile 'org.hamcrest:hamcrest-all:1.3' @@ -167,15 +168,15 @@ dependencies { testCompile 'org.springframework:spring-test:4.3.8.RELEASE' testCompile 'org.springframework.boot:spring-boot-test' testCompile 'org.springframework.boot:spring-boot-starter-test' - testCompile 'org.skyscreamer:jsonassert:1.3.0' + testCompile 'org.skyscreamer:jsonassert:1.5.0' testCompile 'uk.co.datumedge:hamcrest-json:0.2' testCompile 'org.mockito:mockito-all:1.10.19' - testCompile('com.jayway.restassured:rest-assured:2.5.0') { + testCompile('com.jayway.restassured:rest-assured:2.9.0') { exclude module: "hamcrest-core" exclude module: "hamcrest-library" } testCompile 'com.jayway.jsonpath:json-path:2.2.0' - testRuntime 'org.pegdown:pegdown:1.1.0' + testRuntime 'org.pegdown:pegdown:1.6.0' } // end::dependencies[] From 8153cc9df297b3758a48d06f2ad3d91d0718eae2 Mon Sep 17 00:00:00 2001 From: Lionel Montrieux Date: Wed, 17 May 2017 15:24:38 +0200 Subject: [PATCH 08/17] aruha-778 Move Spring boot version number --- build.gradle | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 480f8d0d8d..14c522425e 100644 --- a/build.gradle +++ b/build.gradle @@ -62,6 +62,10 @@ sourceSets { } buildscript { + ext { + springBootVersion = '1.5.3.RELEASE' + } + repositories { mavenCentral() maven { @@ -70,7 +74,7 @@ buildscript { } dependencies { - classpath "org.springframework.boot:spring-boot-gradle-plugin:1.5.3.RELEASE" + classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}" classpath 'org.yaml:snakeyaml:1.14' } } @@ -100,27 +104,27 @@ dependencies { pgsql 'org.postgresql:postgresql:42.1.1' // spring - compile('org.springframework.boot:spring-boot-starter-web:1.5.3.RELEASE') { + compile("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") { exclude module: 'logback-classic' exclude module: 'log4j-over-slf4j' } compile 'org.springframework:spring-context:4.3.8.RELEASE' compile 'org.springframework:spring-web:4.3.8.RELEASE' compile 'org.springframework:spring-webmvc:4.3.8.RELEASE' - compile 'org.springframework.boot:spring-boot-test:1.5.3.RELEASE' + compile 'org.springframework.boot:spring-boot-test' // oauth compile 'org.springframework.security.oauth:spring-security-oauth2:2.1.0.RELEASE' - compile('org.springframework.boot:spring-boot-starter-security') { + compile("org.springframework.boot:spring-boot-starter-security:$springBootVersion") { exclude module: "logback-classic" } // actuator - compile 'org.springframework.boot:spring-boot-starter-actuator:1.5.3.RELEASE' + compile "org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}" compile 'org.zalando.zmon:zmon-actuator:0.9.7' // storage - compile 'org.springframework.boot:spring-boot-starter-jdbc:1.5.3.RELEASE' + compile "org.springframework.boot:spring-boot-starter-jdbc:${springBootVersion}" compile 'org.postgresql:postgresql:42.1.1' compile 'org.springframework.cloud:spring-cloud-starter-hystrix:1.3.0.RELEASE' @@ -166,8 +170,8 @@ dependencies { exclude module: "hamcrest-core" } testCompile 'org.springframework:spring-test:4.3.8.RELEASE' - testCompile 'org.springframework.boot:spring-boot-test' - testCompile 'org.springframework.boot:spring-boot-starter-test' + testCompile "org.springframework.boot:spring-boot-test:${springBootVersion}" + testCompile "org.springframework.boot:spring-boot-starter-test:${springBootVersion}" testCompile 'org.skyscreamer:jsonassert:1.5.0' testCompile 'uk.co.datumedge:hamcrest-json:0.2' testCompile 'org.mockito:mockito-all:1.10.19' From 3e98e76ab700f3c6dfc87ae982d63010445df170 Mon Sep 17 00:00:00 2001 From: Lionel Montrieux Date: Wed, 17 May 2017 15:51:18 +0200 Subject: [PATCH 09/17] aruha-778 Remove redundant entry --- build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/build.gradle b/build.gradle index 14c522425e..d31e918d3a 100644 --- a/build.gradle +++ b/build.gradle @@ -102,7 +102,6 @@ dependencies { dropwizardVersion = '3.1.2' } - pgsql 'org.postgresql:postgresql:42.1.1' // spring compile("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") { exclude module: 'logback-classic' From f9eaafe2e9ae9fae9233e2790d759eb55ee59425 Mon Sep 17 00:00:00 2001 From: Lionel Montrieux Date: Wed, 17 May 2017 15:56:10 +0200 Subject: [PATCH 10/17] aruha-778 Extract spring framework version number to variable --- build.gradle | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index d31e918d3a..36b45fead9 100644 --- a/build.gradle +++ b/build.gradle @@ -64,6 +64,7 @@ sourceSets { buildscript { ext { springBootVersion = '1.5.3.RELEASE' + springFrameworkVersion = '4.3.8.RELEASE' } repositories { @@ -107,9 +108,9 @@ dependencies { exclude module: 'logback-classic' exclude module: 'log4j-over-slf4j' } - compile 'org.springframework:spring-context:4.3.8.RELEASE' - compile 'org.springframework:spring-web:4.3.8.RELEASE' - compile 'org.springframework:spring-webmvc:4.3.8.RELEASE' + compile "org.springframework:spring-context:$springFrameworkVersion" + compile "org.springframework:spring-web:$springFrameworkVersion" + compile "org.springframework:spring-webmvc:$springFrameworkVersion" compile 'org.springframework.boot:spring-boot-test' // oauth @@ -119,11 +120,11 @@ dependencies { } // actuator - compile "org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}" + compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" compile 'org.zalando.zmon:zmon-actuator:0.9.7' // storage - compile "org.springframework.boot:spring-boot-starter-jdbc:${springBootVersion}" + compile "org.springframework.boot:spring-boot-starter-jdbc:$springBootVersion" compile 'org.postgresql:postgresql:42.1.1' compile 'org.springframework.cloud:spring-cloud-starter-hystrix:1.3.0.RELEASE' @@ -168,7 +169,7 @@ dependencies { testCompile('junit:junit:4.12') { exclude module: "hamcrest-core" } - testCompile 'org.springframework:spring-test:4.3.8.RELEASE' + testCompile "org.springframework:spring-test:$springFrameworkVersion" testCompile "org.springframework.boot:spring-boot-test:${springBootVersion}" testCompile "org.springframework.boot:spring-boot-starter-test:${springBootVersion}" testCompile 'org.skyscreamer:jsonassert:1.5.0' From b8572b1501ef0b4d24317d45f23d78713d32b657 Mon Sep 17 00:00:00 2001 From: Lionel Montrieux Date: Fri, 19 May 2017 11:53:30 +0200 Subject: [PATCH 11/17] ARUHA-778 Downgrade jackson --- build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 36b45fead9..62e6eecf59 100644 --- a/build.gradle +++ b/build.gradle @@ -157,10 +157,10 @@ dependencies { // json compile 'org.everit.json:org.everit.json.schema:1.5.1' - compile ('com.fasterxml.jackson.datatype:jackson-datatype-json-org:2.8.8') { + compile ('com.fasterxml.jackson.datatype:jackson-datatype-json-org:2.6.1') { exclude module: "json" } - compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.8.8' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.6.1' compile 'org.zalando:twintip-spring-web:1.1.0' compile 'com.grack:nanojson:1.2' @@ -358,4 +358,4 @@ checkstyle { task checkstyle { dependsOn checkstyleMain, checkstyleTest, checkstyleAcceptanceTest -} \ No newline at end of file +} From 4ad655135cfba8e1c8fd80feaf5011d4ac05831a Mon Sep 17 00:00:00 2001 From: Lionel Montrieux Date: Mon, 22 May 2017 10:12:22 +0200 Subject: [PATCH 12/17] aruha-778 Exclude some modules from dependencies --- build.gradle | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 62e6eecf59..fcce629176 100644 --- a/build.gradle +++ b/build.gradle @@ -136,7 +136,11 @@ dependencies { } compile 'org.zalando:jackson-datatype-problem:0.5.0' compile 'org.zalando:problem:0.5.0' - compile 'org.zalando:problem-spring-web:0.5.0' + compile ('org.zalando:problem-spring-web:0.5.0') { + exclude module: "spring-security-web" + exclude module: "spring-mvc" + exclude module: "jackson-datatype-problem" + } compile 'com.google.guava:guava:19.0' compile 'javax.ws.rs:javax.ws.rs-api:2.0.1' compile 'org.slf4j:slf4j-log4j12:1.7.25' @@ -161,7 +165,12 @@ dependencies { exclude module: "json" } compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.6.1' - compile 'org.zalando:twintip-spring-web:1.1.0' + compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.6.1' + compile ('org.zalando:twintip-spring-web:1.1.0') { + exclude module: "spring-web" + exclude module: "jackson-databind" + exclude module: "jackson-dataformat-yaml" + } compile 'com.grack:nanojson:1.2' // tests From c5c0f72b490d940e505f91523eb5f00c7a637ced Mon Sep 17 00:00:00 2001 From: Lionel Montrieux Date: Mon, 22 May 2017 11:19:48 +0200 Subject: [PATCH 13/17] Revert "ARUHA-778 Downgrade jackson" This reverts commit b8572b1501ef0b4d24317d45f23d78713d32b657. # Conflicts: # build.gradle --- build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index fcce629176..226f3a88e3 100644 --- a/build.gradle +++ b/build.gradle @@ -161,11 +161,11 @@ dependencies { // json compile 'org.everit.json:org.everit.json.schema:1.5.1' - compile ('com.fasterxml.jackson.datatype:jackson-datatype-json-org:2.6.1') { + compile ('com.fasterxml.jackson.datatype:jackson-datatype-json-org:2.8.8') { exclude module: "json" } - compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.6.1' - compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.6.1' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.8.8' + compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.8' compile ('org.zalando:twintip-spring-web:1.1.0') { exclude module: "spring-web" exclude module: "jackson-databind" From 5454c7751cc1e47beca70fd62872355a97b93de5 Mon Sep 17 00:00:00 2001 From: Lionel Montrieux Date: Mon, 22 May 2017 13:32:51 +0200 Subject: [PATCH 14/17] ARUHA-778 exclude json dependencies --- build.gradle | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 226f3a88e3..506c105511 100644 --- a/build.gradle +++ b/build.gradle @@ -76,7 +76,7 @@ buildscript { dependencies { classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}" - classpath 'org.yaml:snakeyaml:1.14' + classpath 'org.yaml:snakeyaml:1.17' } } @@ -107,6 +107,7 @@ dependencies { compile("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") { exclude module: 'logback-classic' exclude module: 'log4j-over-slf4j' + exclude module: 'json' } compile "org.springframework:spring-context:$springFrameworkVersion" compile "org.springframework:spring-web:$springFrameworkVersion" @@ -117,11 +118,14 @@ dependencies { compile 'org.springframework.security.oauth:spring-security-oauth2:2.1.0.RELEASE' compile("org.springframework.boot:spring-boot-starter-security:$springBootVersion") { exclude module: "logback-classic" + exclude module: "json" } // actuator compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" - compile 'org.zalando.zmon:zmon-actuator:0.9.7' + compile ('org.zalando.zmon:zmon-actuator:0.9.7') { + exclude module: "spring-boot-dependencies" + } // storage compile "org.springframework.boot:spring-boot-starter-jdbc:$springBootVersion" From 75fe435fede7f344af4b939e86d70b01e8afbb44 Mon Sep 17 00:00:00 2001 From: Lionel Montrieux Date: Mon, 22 May 2017 15:10:18 +0200 Subject: [PATCH 15/17] ARUHA-778 add project report plugin Generate cool dependency reports with `gradle htmlDependencyReport` --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index 506c105511..00b6c8bb31 100644 --- a/build.gradle +++ b/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'org.springframework.boot' apply plugin: "jacoco" apply plugin: 'findbugs' apply plugin: 'checkstyle' +apply plugin: 'project-report' group 'org.zalando' sourceCompatibility = 1.8 From 337cece738019999fd3ede7f01f7e32f9035bc49 Mon Sep 17 00:00:00 2001 From: Lionel Montrieux Date: Tue, 23 May 2017 09:25:48 +0200 Subject: [PATCH 16/17] ARUHA-778 Fix deployment --- build.gradle | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/build.gradle b/build.gradle index 00b6c8bb31..27b6f6d3cf 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ apply plugin: 'java' apply plugin: 'groovy' apply plugin: 'eclipse' apply plugin: 'application' -apply plugin: 'org.springframework.boot' +apply plugin: 'spring-boot' apply plugin: "jacoco" apply plugin: 'findbugs' apply plugin: 'checkstyle' @@ -76,7 +76,7 @@ buildscript { } dependencies { - classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}" + classpath "org.springframework.boot:spring-boot-gradle-plugin:1.2.5.RELEASE" classpath 'org.yaml:snakeyaml:1.17' } } @@ -105,28 +105,24 @@ dependencies { } // spring - compile("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") { + compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") { exclude module: 'logback-classic' exclude module: 'log4j-over-slf4j' - exclude module: 'json' } compile "org.springframework:spring-context:$springFrameworkVersion" compile "org.springframework:spring-web:$springFrameworkVersion" compile "org.springframework:spring-webmvc:$springFrameworkVersion" - compile 'org.springframework.boot:spring-boot-test' + compile "org.springframework.boot:spring-boot-test:$springBootVersion" // oauth compile 'org.springframework.security.oauth:spring-security-oauth2:2.1.0.RELEASE' - compile("org.springframework.boot:spring-boot-starter-security:$springBootVersion") { + compile('org.springframework.boot:spring-boot-starter-security') { exclude module: "logback-classic" - exclude module: "json" } // actuator compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" - compile ('org.zalando.zmon:zmon-actuator:0.9.7') { - exclude module: "spring-boot-dependencies" - } + compile 'org.zalando.zmon:zmon-actuator:0.9.7' // storage compile "org.springframework.boot:spring-boot-starter-jdbc:$springBootVersion" @@ -141,11 +137,7 @@ dependencies { } compile 'org.zalando:jackson-datatype-problem:0.5.0' compile 'org.zalando:problem:0.5.0' - compile ('org.zalando:problem-spring-web:0.5.0') { - exclude module: "spring-security-web" - exclude module: "spring-mvc" - exclude module: "jackson-datatype-problem" - } + compile 'org.zalando:problem-spring-web:0.5.0' compile 'com.google.guava:guava:19.0' compile 'javax.ws.rs:javax.ws.rs-api:2.0.1' compile 'org.slf4j:slf4j-log4j12:1.7.25' @@ -156,7 +148,6 @@ dependencies { compile 'org.apache.commons:commons-lang3:3.5' compile 'org.zalando:nakadi-plugin-api:1.0.5' compile 'org.echocat.jomon:runtime:1.6.3' - compile 'org.json:json:20160810' // kafka & zookeeper compile 'org.apache.kafka:kafka-clients:0.9.0.1' @@ -171,12 +162,9 @@ dependencies { } compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.8.8' compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.8' - compile ('org.zalando:twintip-spring-web:1.1.0') { - exclude module: "spring-web" - exclude module: "jackson-databind" - exclude module: "jackson-dataformat-yaml" - } + compile 'org.zalando:twintip-spring-web:1.1.0' compile 'com.grack:nanojson:1.2' + compile 'org.json:json:20160810' // tests testCompile 'org.hamcrest:hamcrest-all:1.3' @@ -184,8 +172,8 @@ dependencies { exclude module: "hamcrest-core" } testCompile "org.springframework:spring-test:$springFrameworkVersion" - testCompile "org.springframework.boot:spring-boot-test:${springBootVersion}" - testCompile "org.springframework.boot:spring-boot-starter-test:${springBootVersion}" + testCompile 'org.springframework.boot:spring-boot-test' + testCompile 'org.springframework.boot:spring-boot-starter-test' testCompile 'org.skyscreamer:jsonassert:1.5.0' testCompile 'uk.co.datumedge:hamcrest-json:0.2' testCompile 'org.mockito:mockito-all:1.10.19' From 48cd516c4a2b2cb3249daa5177a85be6787cb7f1 Mon Sep 17 00:00:00 2001 From: Lionel Montrieux Date: Thu, 8 Jun 2017 10:43:41 +0200 Subject: [PATCH 17/17] ARUHA-756 Fix typo ... and hopefully zappr will work. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 215a0d665e..d390685708 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ The project also provides compatability with the [STUPS project](https://stups.i * Filtering of events for subscribing consumers. -* Role base access control to data. +* Role based access control to data. * Support for different streaming technologies and engines. Nakadi currently uses [Apache Kafka](http://kafka.apache.org/) as its broker, but other providers (such as Kinesis) will be possible.