From 8022324b0f39d9da43db1911f5b7565617315a77 Mon Sep 17 00:00:00 2001 From: Pavel Popov Date: Fri, 10 Jul 2020 17:37:11 +0300 Subject: [PATCH] Switch to docker hub (#29) * Switch to docker hub * Fix Jenkinsfile * Fix version of kafka dep * Bump testcontainers version, add provded scope in lombock dep * Add kafka-streams dep, bump postgres testcontainers version * Set logs levels for tests * Tune logs again * Rollback testcontainers version * Increase kafka startup timeout --- Jenkinsfile | 4 +- build_utils | 2 +- pom.xml | 92 ++++++++----------- .../management/config/KafkaConfig.java | 2 +- .../serializer/CommandChangeDeserializer.java | 4 +- .../serializer/CommandFraudDeserializer.java | 4 +- .../serializer/EventDeserializer.java | 4 +- .../AbstractKafkaIntegrationTest.java | 6 +- src/test/resources/logback-test.xml | 5 +- 9 files changed, 54 insertions(+), 69 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 916d31b..375684c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,8 +11,6 @@ build('fraudbusters-management', 'java-maven') { def serviceName = env.REPO_NAME def mvnArgs = '-DjvmArgs="-Xmx256m"' def useJava11 = true - def registry = 'dr2.rbkmoney.com' - def registryCredsId = 'jenkins_harbor' - javaServicePipeline(serviceName, useJava11, mvnArgs, registry, registryCredsId) + javaServicePipeline(serviceName, useJava11, mvnArgs) } \ No newline at end of file diff --git a/build_utils b/build_utils index 4e6aae0..5cb25f0 160000 --- a/build_utils +++ b/build_utils @@ -1 +1 @@ -Subproject commit 4e6aae0f31885d3c56d09c72de7ef8d432149dbf +Subproject commit 5cb25f049c719a608276a99fc4fbe852187019ca diff --git a/pom.xml b/pom.xml index c20095a..336466b 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.rbkmoney spring-boot-starter-parent - 2.1.1.RELEASE + 2.3.0.RELEASE-2 fraudbusters-management @@ -24,7 +24,7 @@ ${server.port} bc95d0d6dc13c693acd2b274531a7d604b877bf3 dr2.rbkmoney.com - 0.3.6 + 0.3.7 5.2.3 fraudbusters 5432 @@ -33,13 +33,12 @@ postgres af ${project.basedir}/target/jacoco.exec - 1.29-4fe14c3 - 2.1.0 - 2.1.0 - 1.44-6db2558 - 0.0.1-SNAPSHOT + 1.33-554d59c + 1.47-357fb85 + 0.1.4 0.0.17 - 0.0.2-SNAPSHOT + 0.6.11 + 0.0.3 @@ -47,12 +46,12 @@ com.rbkmoney spring-boot-starter-metrics-statsd - 1.1.0 + 1.1.2 com.rbkmoney.woody woody-thrift - 1.1.15 + 1.1.21 com.rbkmoney @@ -62,12 +61,12 @@ com.rbkmoney.geck filter - 0.6.9 + ${geck.version} com.rbkmoney.geck serializer - 0.6.9 + ${geck.version} com.rbkmoney @@ -122,6 +121,24 @@ org.springframework.boot spring-boot-starter-jdbc + + org.springframework.kafka + spring-kafka + + + org.springframework.boot + spring-boot-starter-validation + + + + + org.springframework.kafka + spring-kafka + + + org.apache.kafka + kafka-streams + @@ -132,7 +149,8 @@ org.projectlombok lombok - 1.18.4 + ${lombok.version} + provided org.flywaydb @@ -176,57 +194,24 @@ 2.9.2 - - - org.apache.kafka - kafka-streams - ${kafka.streams.version} - - - org.apache.kafka - kafka-clients - ${kafka.clients.version} - - - org.springframework.kafka - spring-kafka - 2.2.2.RELEASE - - - org.apache.kafka - kafka-streams - - - org.apache.kafka - kafka-clients - - - - - org.testcontainers - kafka - 1.10.2 - test - - org.springframework.boot spring-boot-starter-test test - - org.testcontainers - postgresql - 1.8.0 - test - io.github.benas random-beans 3.6.0 test + + org.testcontainers + postgresql + 1.10.2 + test + org.testcontainers kafka @@ -236,7 +221,6 @@ org.apache.kafka kafka-streams-test-utils - 2.1.0 test @@ -362,7 +346,7 @@ com.rbkmoney.maven.plugins pg-embedded-plugin - 1.4 + 1.5 ${db.port} ${db.name} diff --git a/src/main/java/com/rbkmoney/fraudbusters/management/config/KafkaConfig.java b/src/main/java/com/rbkmoney/fraudbusters/management/config/KafkaConfig.java index 4c8cac5..27c220f 100644 --- a/src/main/java/com/rbkmoney/fraudbusters/management/config/KafkaConfig.java +++ b/src/main/java/com/rbkmoney/fraudbusters/management/config/KafkaConfig.java @@ -4,7 +4,7 @@ import com.rbkmoney.damsel.fraudbusters.Command; import com.rbkmoney.damsel.wb_list.Event; import com.rbkmoney.fraudbusters.management.serializer.CommandFraudDeserializer; import com.rbkmoney.fraudbusters.management.serializer.EventDeserializer; -import com.rbkmoney.serializer.ThriftSerializer; +import com.rbkmoney.kafka.common.serialization.ThriftSerializer; import org.apache.kafka.clients.CommonClientConfigs; import org.apache.kafka.clients.consumer.ConsumerConfig; import org.apache.kafka.clients.producer.ProducerConfig; diff --git a/src/main/java/com/rbkmoney/fraudbusters/management/serializer/CommandChangeDeserializer.java b/src/main/java/com/rbkmoney/fraudbusters/management/serializer/CommandChangeDeserializer.java index 7c43597..e3f2fd4 100644 --- a/src/main/java/com/rbkmoney/fraudbusters/management/serializer/CommandChangeDeserializer.java +++ b/src/main/java/com/rbkmoney/fraudbusters/management/serializer/CommandChangeDeserializer.java @@ -2,11 +2,11 @@ package com.rbkmoney.fraudbusters.management.serializer; import com.rbkmoney.damsel.wb_list.ChangeCommand; -import com.rbkmoney.deserializer.AbstractDeserializerAdapter; +import com.rbkmoney.kafka.common.serialization.AbstractThriftDeserializer; import lombok.extern.slf4j.Slf4j; @Slf4j -public class CommandChangeDeserializer extends AbstractDeserializerAdapter { +public class CommandChangeDeserializer extends AbstractThriftDeserializer { @Override public ChangeCommand deserialize(String topic, byte[] data) { diff --git a/src/main/java/com/rbkmoney/fraudbusters/management/serializer/CommandFraudDeserializer.java b/src/main/java/com/rbkmoney/fraudbusters/management/serializer/CommandFraudDeserializer.java index e865029..fe9653e 100644 --- a/src/main/java/com/rbkmoney/fraudbusters/management/serializer/CommandFraudDeserializer.java +++ b/src/main/java/com/rbkmoney/fraudbusters/management/serializer/CommandFraudDeserializer.java @@ -2,11 +2,11 @@ package com.rbkmoney.fraudbusters.management.serializer; import com.rbkmoney.damsel.fraudbusters.Command; -import com.rbkmoney.deserializer.AbstractDeserializerAdapter; +import com.rbkmoney.kafka.common.serialization.AbstractThriftDeserializer; import lombok.extern.slf4j.Slf4j; @Slf4j -public class CommandFraudDeserializer extends AbstractDeserializerAdapter { +public class CommandFraudDeserializer extends AbstractThriftDeserializer { @Override public Command deserialize(String topic, byte[] data) { diff --git a/src/main/java/com/rbkmoney/fraudbusters/management/serializer/EventDeserializer.java b/src/main/java/com/rbkmoney/fraudbusters/management/serializer/EventDeserializer.java index dd89635..4ee0137 100644 --- a/src/main/java/com/rbkmoney/fraudbusters/management/serializer/EventDeserializer.java +++ b/src/main/java/com/rbkmoney/fraudbusters/management/serializer/EventDeserializer.java @@ -2,11 +2,11 @@ package com.rbkmoney.fraudbusters.management.serializer; import com.rbkmoney.damsel.wb_list.Event; -import com.rbkmoney.deserializer.AbstractDeserializerAdapter; +import com.rbkmoney.kafka.common.serialization.AbstractThriftDeserializer; import lombok.extern.slf4j.Slf4j; @Slf4j -public class EventDeserializer extends AbstractDeserializerAdapter { +public class EventDeserializer extends AbstractThriftDeserializer { @Override public Event deserialize(String topic, byte[] data) { diff --git a/src/test/java/com/rbkmoney/fraudbusters/management/AbstractKafkaIntegrationTest.java b/src/test/java/com/rbkmoney/fraudbusters/management/AbstractKafkaIntegrationTest.java index a966d23..6cebfbf 100644 --- a/src/test/java/com/rbkmoney/fraudbusters/management/AbstractKafkaIntegrationTest.java +++ b/src/test/java/com/rbkmoney/fraudbusters/management/AbstractKafkaIntegrationTest.java @@ -2,7 +2,7 @@ package com.rbkmoney.fraudbusters.management; import com.rbkmoney.fraudbusters.management.config.KafkaConfig; import com.rbkmoney.fraudbusters.management.serializer.EventDeserializer; -import com.rbkmoney.serializer.ThriftSerializer; +import com.rbkmoney.kafka.common.serialization.ThriftSerializer; import lombok.extern.slf4j.Slf4j; import org.apache.kafka.clients.consumer.Consumer; import org.apache.kafka.clients.consumer.ConsumerConfig; @@ -36,7 +36,9 @@ public abstract class AbstractKafkaIntegrationTest { public static final String KAFKA_DOCKER_VERSION = "5.0.1"; @ClassRule - public static KafkaContainer kafka = new KafkaContainer(KAFKA_DOCKER_VERSION).withEmbeddedZookeeper(); + public static KafkaContainer kafka = new KafkaContainer(KAFKA_DOCKER_VERSION) + .withEmbeddedZookeeper() + .withStartupTimeout(Duration.ofMinutes(10)); public static class Initializer implements ApplicationContextInitializer { public static final String WB_LIST_EVENT_SINK = "wb-list-event-sink"; diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index 8526e19..143f035 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -3,9 +3,10 @@ - + - + +