From f940f1e26b4d1d7f917b1524e87f1aaa56dcf47b Mon Sep 17 00:00:00 2001 From: Hassan Elseoudy Date: Fri, 3 May 2024 16:52:36 +0200 Subject: [PATCH 1/9] MISC try to update for spring boot 3. --- nakadi-producer-loadtest/pom.xml | 2 +- .../src/test/resources/docker-compose.yaml | 4 +-- nakadi-producer-spring-boot-starter/pom.xml | 23 ++++++-------- .../nakadiproducer/FlywayMigrator.java | 2 +- .../NakadiProducerFlywayCallbackIT.java | 3 +- .../NonNakadiProducerFlywayCallbackIT.java | 2 +- .../eventlog/impl/EventLogRepositoryIT.java | 2 +- .../SnapshotEventGenerationWebEndpointIT.java | 4 +-- .../pom.xml | 1 - nakadi-producer/pom.xml | 30 ++++++++++--------- .../eventlog/EventLogWriter.java | 2 +- .../eventlog/impl/EventLogWriterImpl.java | 6 ++-- .../impl/EventTransmissionService.java | 2 +- .../impl/EventTransmissionServiceTest.java | 4 +-- pom.xml | 4 +-- 15 files changed, 43 insertions(+), 48 deletions(-) diff --git a/nakadi-producer-loadtest/pom.xml b/nakadi-producer-loadtest/pom.xml index c7bc3b7c..4ff281fd 100644 --- a/nakadi-producer-loadtest/pom.xml +++ b/nakadi-producer-loadtest/pom.xml @@ -56,7 +56,7 @@ org.projectlombok lombok - 1.18.22 + 1.18.30 provided diff --git a/nakadi-producer-loadtest/src/test/resources/docker-compose.yaml b/nakadi-producer-loadtest/src/test/resources/docker-compose.yaml index a0bfe00a..e647617d 100644 --- a/nakadi-producer-loadtest/src/test/resources/docker-compose.yaml +++ b/nakadi-producer-loadtest/src/test/resources/docker-compose.yaml @@ -2,7 +2,7 @@ version: '2' services: nakadi: - image: adyach/nakadi-docker:3.0.8 + image: ghcr.io/adyach/nakadi-docker/nakadi:3.5 ports: - "8080:8080" depends_on: @@ -16,7 +16,7 @@ services: - SPRING_DATASOURCE_URL=jdbc:postgresql://postgres_nakadi:5432/local_nakadi_db postgres_nakadi: - image: adyach/nakadi-postgres:latest + image: ghcr.io/adyach/nakadi-docker/postgres:latest ports: - "5432:5432" environment: diff --git a/nakadi-producer-spring-boot-starter/pom.xml b/nakadi-producer-spring-boot-starter/pom.xml index 6464287a..f7d4f7ee 100644 --- a/nakadi-producer-spring-boot-starter/pom.xml +++ b/nakadi-producer-spring-boot-starter/pom.xml @@ -19,9 +19,9 @@ Spring Boot Auto Configuration for Nakadi event producer - 11 - 11 - 11 + 21 + 21 + 21 @@ -41,6 +41,7 @@ org.projectlombok lombok + 1.18.30 provided @@ -65,12 +66,6 @@ spring-boot-starter-test test - - org.postgresql - postgresql - 42.4.3 - test - io.zonky.test embedded-postgres @@ -84,9 +79,9 @@ test - com.jayway.restassured + io.rest-assured rest-assured - 2.4.0 + 5.4.0 test @@ -128,7 +123,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.3.1 attach-sources @@ -141,9 +136,9 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.9.1 + 3.6.3 - -Xdoclint:none + none diff --git a/nakadi-producer-spring-boot-starter/src/main/java/org/zalando/nakadiproducer/FlywayMigrator.java b/nakadi-producer-spring-boot-starter/src/main/java/org/zalando/nakadiproducer/FlywayMigrator.java index becd45e7..c9e144b6 100644 --- a/nakadi-producer-spring-boot-starter/src/main/java/org/zalando/nakadiproducer/FlywayMigrator.java +++ b/nakadi-producer-spring-boot-starter/src/main/java/org/zalando/nakadiproducer/FlywayMigrator.java @@ -1,8 +1,8 @@ package org.zalando.nakadiproducer; -import javax.annotation.PostConstruct; import javax.sql.DataSource; +import jakarta.annotation.PostConstruct; import org.flywaydb.core.Flyway; import org.flywaydb.core.api.callback.BaseCallback; import org.flywaydb.core.api.callback.Context; diff --git a/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/NakadiProducerFlywayCallbackIT.java b/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/NakadiProducerFlywayCallbackIT.java index 90971ece..0cf9ec08 100644 --- a/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/NakadiProducerFlywayCallbackIT.java +++ b/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/NakadiProducerFlywayCallbackIT.java @@ -1,7 +1,6 @@ package org.zalando.nakadiproducer; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.inOrder; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/NonNakadiProducerFlywayCallbackIT.java b/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/NonNakadiProducerFlywayCallbackIT.java index 1d216650..96725d73 100644 --- a/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/NonNakadiProducerFlywayCallbackIT.java +++ b/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/NonNakadiProducerFlywayCallbackIT.java @@ -1,6 +1,6 @@ package org.zalando.nakadiproducer; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; diff --git a/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/eventlog/impl/EventLogRepositoryIT.java b/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/eventlog/impl/EventLogRepositoryIT.java index 4370e1ef..e75d9daf 100644 --- a/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/eventlog/impl/EventLogRepositoryIT.java +++ b/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/eventlog/impl/EventLogRepositoryIT.java @@ -4,7 +4,7 @@ import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.core.Is.is; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/snapshots/SnapshotEventGenerationWebEndpointIT.java b/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/snapshots/SnapshotEventGenerationWebEndpointIT.java index f8bb8f46..da4aa56a 100644 --- a/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/snapshots/SnapshotEventGenerationWebEndpointIT.java +++ b/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/snapshots/SnapshotEventGenerationWebEndpointIT.java @@ -1,6 +1,6 @@ package org.zalando.nakadiproducer.snapshots; -import static com.jayway.restassured.RestAssured.given; +import static io.restassured.RestAssured.given; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.verify; @@ -9,8 +9,8 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.actuate.autoconfigure.web.server.LocalManagementPort; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.web.server.LocalManagementPort; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.test.context.ActiveProfiles; diff --git a/nakadi-producer-starter-spring-boot-2-test/pom.xml b/nakadi-producer-starter-spring-boot-2-test/pom.xml index 2c2d9608..9b718f80 100644 --- a/nakadi-producer-starter-spring-boot-2-test/pom.xml +++ b/nakadi-producer-starter-spring-boot-2-test/pom.xml @@ -31,7 +31,6 @@ org.springframework.boot spring-boot-starter-jdbc - 2.5.6 com.opentable.components diff --git a/nakadi-producer/pom.xml b/nakadi-producer/pom.xml index 5de5d1c5..c75b67c8 100644 --- a/nakadi-producer/pom.xml +++ b/nakadi-producer/pom.xml @@ -19,15 +19,16 @@ Reliable transactional Nakadi event producer - 11 - 11 - 11 + 21 + 21 + 21 - javax.transaction - javax.transaction-api + jakarta.transaction + jakarta.transaction-api + 2.0.1 com.fasterxml.jackson.core @@ -44,11 +45,12 @@ org.zalando fahrschein - 0.24.0 + 2.0.2 org.projectlombok lombok + 1.18.30 provided - javax.interceptor - javax.interceptor-api - 1.2.2 + jakarta.interceptor + jakarta.interceptor-api + 2.2.0 provided true org.hamcrest - hamcrest-all - 1.3 + hamcrest + 2.2 test @@ -86,12 +88,12 @@ org.springframework spring-core - 5.3.27 + 6.1.6 org.mockito mockito-junit-jupiter - 3.9.0 + 5.11.0 test @@ -128,7 +130,7 @@ org.apache.maven.plugins maven-javadoc-plugin - -Xdoclint:none + none diff --git a/nakadi-producer/src/main/java/org/zalando/nakadiproducer/eventlog/EventLogWriter.java b/nakadi-producer/src/main/java/org/zalando/nakadiproducer/eventlog/EventLogWriter.java index fa4a4ddd..83aeb143 100644 --- a/nakadi-producer/src/main/java/org/zalando/nakadiproducer/eventlog/EventLogWriter.java +++ b/nakadi-producer/src/main/java/org/zalando/nakadiproducer/eventlog/EventLogWriter.java @@ -1,8 +1,8 @@ package org.zalando.nakadiproducer.eventlog; import java.util.Collection; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import org.zalando.nakadiproducer.snapshots.SnapshotEventGenerator; /** diff --git a/nakadi-producer/src/main/java/org/zalando/nakadiproducer/eventlog/impl/EventLogWriterImpl.java b/nakadi-producer/src/main/java/org/zalando/nakadiproducer/eventlog/impl/EventLogWriterImpl.java index 86d93c79..9d34369d 100644 --- a/nakadi-producer/src/main/java/org/zalando/nakadiproducer/eventlog/impl/EventLogWriterImpl.java +++ b/nakadi-producer/src/main/java/org/zalando/nakadiproducer/eventlog/impl/EventLogWriterImpl.java @@ -16,7 +16,7 @@ import org.zalando.nakadiproducer.flowid.FlowIdComponent; import org.zalando.nakadiproducer.eventlog.EventLogWriter; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -58,9 +58,9 @@ private static CompactionKeyExtractor joinCompactors(List list.stream() .flatMap(ex -> ex.tryGetKeyFor(o).stream()) .findAny() diff --git a/nakadi-producer/src/main/java/org/zalando/nakadiproducer/transmission/impl/EventTransmissionService.java b/nakadi-producer/src/main/java/org/zalando/nakadiproducer/transmission/impl/EventTransmissionService.java index a12ad389..2b943ec3 100644 --- a/nakadi-producer/src/main/java/org/zalando/nakadiproducer/transmission/impl/EventTransmissionService.java +++ b/nakadi-producer/src/main/java/org/zalando/nakadiproducer/transmission/impl/EventTransmissionService.java @@ -10,7 +10,7 @@ import org.zalando.nakadiproducer.transmission.NakadiPublishingClient; import org.zalando.nakadiproducer.transmission.impl.EventBatcher.BatchItem; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.io.IOException; import java.time.Clock; diff --git a/nakadi-producer/src/test/java/org/zalando/nakadiproducer/transmission/impl/EventTransmissionServiceTest.java b/nakadi-producer/src/test/java/org/zalando/nakadiproducer/transmission/impl/EventTransmissionServiceTest.java index 8ea8a05e..1b2dabee 100644 --- a/nakadi-producer/src/test/java/org/zalando/nakadiproducer/transmission/impl/EventTransmissionServiceTest.java +++ b/nakadi-producer/src/test/java/org/zalando/nakadiproducer/transmission/impl/EventTransmissionServiceTest.java @@ -10,7 +10,7 @@ import org.mockito.Captor; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.zalando.fahrschein.EventPublishingException; +import org.zalando.fahrschein.RawEventPersistenceException; import org.zalando.fahrschein.domain.BatchItemResponse; import org.zalando.nakadiproducer.eventlog.impl.EventLog; import org.zalando.nakadiproducer.eventlog.impl.EventLogRepository; @@ -183,7 +183,7 @@ public void testEventPublishingExceptionIsHandledGracefully() throws Exception { EventLog ev2 = new EventLog(2, "type1", payloadString, null, now(), now(), null, now().plus(5, MINUTES), null); EventLog ev3 = new EventLog(3, "type2", payloadString, null, now(), now(), null, now().plus(5, MINUTES), null); - doThrow(new EventPublishingException(new BatchItemResponse[]{ + doThrow(new RawEventPersistenceException(new BatchItemResponse[]{ new BatchItemResponse("00000000-0000-0000-0000-000000000002", BatchItemResponse.PublishingStatus.ABORTED, BatchItemResponse.Step.ENRICHING, "Something went wrong") })) .when(publishingClient).publish(eq("type1"), any()); diff --git a/pom.xml b/pom.xml index e4449017..62d8716d 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.boot spring-boot-starter-parent - 2.5.6 + 3.2.5 nakadi-producer-reactor @@ -56,7 +56,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.7 + 1.6.13 true ossrh From 1c0ac7f4d72ba4a4c6158d8700338a091420d3cb Mon Sep 17 00:00:00 2001 From: Lucas Medeiros de Azevedo Date: Tue, 7 May 2024 16:14:18 +0200 Subject: [PATCH 2/9] Fix autoconfiguration and other things for SB 3 --- nakadi-producer-loadtest/pom.xml | 2 +- .../zalando/nakadiproducer/LoadTestIT.java | 5 +-- .../src/test/resources/docker-compose.yaml | 6 ++-- .../main/resources/META-INF/spring.factories | 2 -- ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../pom.xml | 33 ++++++++++++------- .../nakadiproducer/tests/Application.java | 2 +- .../src/main/resources/application.yml | 0 .../resources/db/migration/V1.1__noop.sql | 0 .../nakadiproducer/tests/ApplicationIT.java | 2 +- .../tests/MockNakadiConfig.java | 0 .../test/resources/tokens/nakadi-token-secret | 0 .../test/resources/tokens/nakadi-token-type | 0 pom.xml | 2 +- 14 files changed, 33 insertions(+), 22 deletions(-) delete mode 100644 nakadi-producer-spring-boot-starter/src/main/resources/META-INF/spring.factories create mode 100644 nakadi-producer-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename {nakadi-producer-starter-spring-boot-2-test => nakadi-producer-starter-spring-boot-3-test}/pom.xml (77%) rename {nakadi-producer-starter-spring-boot-2-test => nakadi-producer-starter-spring-boot-3-test}/src/main/java/org/zalando/nakadiproducer/tests/Application.java (96%) rename {nakadi-producer-starter-spring-boot-2-test => nakadi-producer-starter-spring-boot-3-test}/src/main/resources/application.yml (100%) rename {nakadi-producer-starter-spring-boot-2-test => nakadi-producer-starter-spring-boot-3-test}/src/main/resources/db/migration/V1.1__noop.sql (100%) rename {nakadi-producer-starter-spring-boot-2-test => nakadi-producer-starter-spring-boot-3-test}/src/test/java/org/zalando/nakadiproducer/tests/ApplicationIT.java (96%) rename {nakadi-producer-starter-spring-boot-2-test => nakadi-producer-starter-spring-boot-3-test}/src/test/java/org/zalando/nakadiproducer/tests/MockNakadiConfig.java (100%) rename {nakadi-producer-starter-spring-boot-2-test => nakadi-producer-starter-spring-boot-3-test}/src/test/resources/tokens/nakadi-token-secret (100%) rename {nakadi-producer-starter-spring-boot-2-test => nakadi-producer-starter-spring-boot-3-test}/src/test/resources/tokens/nakadi-token-type (100%) diff --git a/nakadi-producer-loadtest/pom.xml b/nakadi-producer-loadtest/pom.xml index 4ff281fd..2869c13c 100644 --- a/nakadi-producer-loadtest/pom.xml +++ b/nakadi-producer-loadtest/pom.xml @@ -50,7 +50,7 @@ org.testcontainers testcontainers - 1.16.0 + 1.19.7 test diff --git a/nakadi-producer-loadtest/src/test/java/org/zalando/nakadiproducer/LoadTestIT.java b/nakadi-producer-loadtest/src/test/java/org/zalando/nakadiproducer/LoadTestIT.java index 86f360e7..2c885b8f 100644 --- a/nakadi-producer-loadtest/src/test/java/org/zalando/nakadiproducer/LoadTestIT.java +++ b/nakadi-producer-loadtest/src/test/java/org/zalando/nakadiproducer/LoadTestIT.java @@ -39,7 +39,8 @@ public class LoadTestIT { public static DockerComposeContainer compose = new DockerComposeContainer(new File("src/test/resources/docker-compose.yaml")) .withExposedService("nakadi", 8080, - Wait.forListeningPort().withStartupTimeout(Duration.ofSeconds(240))); + Wait.forListeningPort().withStartupTimeout(Duration.ofSeconds(240))) + .withOptions("--compatibility"); @Autowired private EventLogWriter eventLogWriter; @@ -123,4 +124,4 @@ private void fireBusinessEvents(int amount) { private void sendEvents() { eventTransmitter.sendEvents(); } -} \ No newline at end of file +} diff --git a/nakadi-producer-loadtest/src/test/resources/docker-compose.yaml b/nakadi-producer-loadtest/src/test/resources/docker-compose.yaml index e647617d..3c6e3c6c 100644 --- a/nakadi-producer-loadtest/src/test/resources/docker-compose.yaml +++ b/nakadi-producer-loadtest/src/test/resources/docker-compose.yaml @@ -25,12 +25,12 @@ services: POSTGRES_DB: local_nakadi_db zookeeper: - image: wurstmeister/zookeeper:3.4.6 + image: bitnami/zookeeper:3.7.2 ports: - "2181:2181" kafka: - image: wurstmeister/kafka:0.10.1.0 + image: bitnami/kafka:0.10.2.1 ports: - "9092:9092" depends_on: @@ -43,4 +43,4 @@ services: KAFKA_DELETE_TOPIC_ENABLE: 'true' KAFKA_BROKER_ID: 0 volumes: - - /var/run/docker.sock:/var/run/docker.sock \ No newline at end of file + - /var/run/docker.sock:/var/run/docker.sock diff --git a/nakadi-producer-spring-boot-starter/src/main/resources/META-INF/spring.factories b/nakadi-producer-spring-boot-starter/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 36e3c26d..00000000 --- a/nakadi-producer-spring-boot-starter/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ -org.zalando.nakadiproducer.NakadiProducerAutoConfiguration \ No newline at end of file diff --git a/nakadi-producer-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/nakadi-producer-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 00000000..0d1680c3 --- /dev/null +++ b/nakadi-producer-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.zalando.nakadiproducer.NakadiProducerAutoConfiguration diff --git a/nakadi-producer-starter-spring-boot-2-test/pom.xml b/nakadi-producer-starter-spring-boot-3-test/pom.xml similarity index 77% rename from nakadi-producer-starter-spring-boot-2-test/pom.xml rename to nakadi-producer-starter-spring-boot-3-test/pom.xml index 9b718f80..1935333b 100644 --- a/nakadi-producer-starter-spring-boot-2-test/pom.xml +++ b/nakadi-producer-starter-spring-boot-3-test/pom.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - nakadi-producer-starter-spring-boot-2-test + nakadi-producer-starter-spring-boot-3-test org.zalando @@ -33,15 +33,9 @@ spring-boot-starter-jdbc - com.opentable.components - otj-pg-embedded - 0.12.0 - - - postgresql - postgresql - - + io.zonky.test + embedded-postgres + 2.0.6 org.springframework.boot @@ -61,13 +55,30 @@ io.rest-assured rest-assured - 4.4.0 + 5.4.0 + + + org.codehaus.groovy + groovy + + + org.codehaus.groovy + groovy-xml + + + + org.apache.maven.plugins + maven-surefire-plugin + + --add-opens java.base/java.util=ALL-UNNAMED + + org.apache.maven.plugins maven-failsafe-plugin diff --git a/nakadi-producer-starter-spring-boot-2-test/src/main/java/org/zalando/nakadiproducer/tests/Application.java b/nakadi-producer-starter-spring-boot-3-test/src/main/java/org/zalando/nakadiproducer/tests/Application.java similarity index 96% rename from nakadi-producer-starter-spring-boot-2-test/src/main/java/org/zalando/nakadiproducer/tests/Application.java rename to nakadi-producer-starter-spring-boot-3-test/src/main/java/org/zalando/nakadiproducer/tests/Application.java index 10db90a9..798428ce 100644 --- a/nakadi-producer-starter-spring-boot-2-test/src/main/java/org/zalando/nakadiproducer/tests/Application.java +++ b/nakadi-producer-starter-spring-boot-3-test/src/main/java/org/zalando/nakadiproducer/tests/Application.java @@ -1,6 +1,6 @@ package org.zalando.nakadiproducer.tests; -import com.opentable.db.postgres.embedded.EmbeddedPostgres; +import io.zonky.test.db.postgres.embedded.EmbeddedPostgres; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Bean; diff --git a/nakadi-producer-starter-spring-boot-2-test/src/main/resources/application.yml b/nakadi-producer-starter-spring-boot-3-test/src/main/resources/application.yml similarity index 100% rename from nakadi-producer-starter-spring-boot-2-test/src/main/resources/application.yml rename to nakadi-producer-starter-spring-boot-3-test/src/main/resources/application.yml diff --git a/nakadi-producer-starter-spring-boot-2-test/src/main/resources/db/migration/V1.1__noop.sql b/nakadi-producer-starter-spring-boot-3-test/src/main/resources/db/migration/V1.1__noop.sql similarity index 100% rename from nakadi-producer-starter-spring-boot-2-test/src/main/resources/db/migration/V1.1__noop.sql rename to nakadi-producer-starter-spring-boot-3-test/src/main/resources/db/migration/V1.1__noop.sql diff --git a/nakadi-producer-starter-spring-boot-2-test/src/test/java/org/zalando/nakadiproducer/tests/ApplicationIT.java b/nakadi-producer-starter-spring-boot-3-test/src/test/java/org/zalando/nakadiproducer/tests/ApplicationIT.java similarity index 96% rename from nakadi-producer-starter-spring-boot-2-test/src/test/java/org/zalando/nakadiproducer/tests/ApplicationIT.java rename to nakadi-producer-starter-spring-boot-3-test/src/test/java/org/zalando/nakadiproducer/tests/ApplicationIT.java index 2b29af03..f4179453 100644 --- a/nakadi-producer-starter-spring-boot-2-test/src/test/java/org/zalando/nakadiproducer/tests/ApplicationIT.java +++ b/nakadi-producer-starter-spring-boot-3-test/src/test/java/org/zalando/nakadiproducer/tests/ApplicationIT.java @@ -4,8 +4,8 @@ import org.junit.contrib.java.lang.system.EnvironmentVariables; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.actuate.autoconfigure.web.server.LocalManagementPort; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.web.server.LocalManagementPort; import org.springframework.test.context.junit4.SpringRunner; import org.zalando.nakadiproducer.transmission.MockNakadiPublishingClient; import org.zalando.nakadiproducer.transmission.impl.EventTransmitter; diff --git a/nakadi-producer-starter-spring-boot-2-test/src/test/java/org/zalando/nakadiproducer/tests/MockNakadiConfig.java b/nakadi-producer-starter-spring-boot-3-test/src/test/java/org/zalando/nakadiproducer/tests/MockNakadiConfig.java similarity index 100% rename from nakadi-producer-starter-spring-boot-2-test/src/test/java/org/zalando/nakadiproducer/tests/MockNakadiConfig.java rename to nakadi-producer-starter-spring-boot-3-test/src/test/java/org/zalando/nakadiproducer/tests/MockNakadiConfig.java diff --git a/nakadi-producer-starter-spring-boot-2-test/src/test/resources/tokens/nakadi-token-secret b/nakadi-producer-starter-spring-boot-3-test/src/test/resources/tokens/nakadi-token-secret similarity index 100% rename from nakadi-producer-starter-spring-boot-2-test/src/test/resources/tokens/nakadi-token-secret rename to nakadi-producer-starter-spring-boot-3-test/src/test/resources/tokens/nakadi-token-secret diff --git a/nakadi-producer-starter-spring-boot-2-test/src/test/resources/tokens/nakadi-token-type b/nakadi-producer-starter-spring-boot-3-test/src/test/resources/tokens/nakadi-token-type similarity index 100% rename from nakadi-producer-starter-spring-boot-2-test/src/test/resources/tokens/nakadi-token-type rename to nakadi-producer-starter-spring-boot-3-test/src/test/resources/tokens/nakadi-token-type diff --git a/pom.xml b/pom.xml index 62d8716d..89d59b81 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ nakadi-producer nakadi-producer-spring-boot-starter - nakadi-producer-starter-spring-boot-2-test + nakadi-producer-starter-spring-boot-3-test nakadi-producer-loadtest From c9f4c47ca7129f23f5942697b311585e55f11014 Mon Sep 17 00:00:00 2001 From: Lucas Medeiros de Azevedo Date: Tue, 7 May 2024 16:16:39 +0200 Subject: [PATCH 3/9] Undo tentative change to get testcontainers to work locally --- .../src/test/java/org/zalando/nakadiproducer/LoadTestIT.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nakadi-producer-loadtest/src/test/java/org/zalando/nakadiproducer/LoadTestIT.java b/nakadi-producer-loadtest/src/test/java/org/zalando/nakadiproducer/LoadTestIT.java index 2c885b8f..c80d5501 100644 --- a/nakadi-producer-loadtest/src/test/java/org/zalando/nakadiproducer/LoadTestIT.java +++ b/nakadi-producer-loadtest/src/test/java/org/zalando/nakadiproducer/LoadTestIT.java @@ -39,8 +39,7 @@ public class LoadTestIT { public static DockerComposeContainer compose = new DockerComposeContainer(new File("src/test/resources/docker-compose.yaml")) .withExposedService("nakadi", 8080, - Wait.forListeningPort().withStartupTimeout(Duration.ofSeconds(240))) - .withOptions("--compatibility"); + Wait.forListeningPort().withStartupTimeout(Duration.ofSeconds(240))); @Autowired private EventLogWriter eventLogWriter; From 3c8a2beb3c6c607bb878073da2aed957c4a0a69a Mon Sep 17 00:00:00 2001 From: Lucas Medeiros de Azevedo Date: Tue, 7 May 2024 16:21:12 +0200 Subject: [PATCH 4/9] Bump version to 30.0.0-SNAPSHOT --- nakadi-producer-loadtest/pom.xml | 2 +- nakadi-producer-spring-boot-starter/pom.xml | 2 +- nakadi-producer-starter-spring-boot-3-test/pom.xml | 2 +- nakadi-producer/pom.xml | 2 +- pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nakadi-producer-loadtest/pom.xml b/nakadi-producer-loadtest/pom.xml index 2869c13c..fd16402d 100644 --- a/nakadi-producer-loadtest/pom.xml +++ b/nakadi-producer-loadtest/pom.xml @@ -10,7 +10,7 @@ org.zalando nakadi-producer-reactor - 21.0.0 + 30.0.0-SNAPSHOT diff --git a/nakadi-producer-spring-boot-starter/pom.xml b/nakadi-producer-spring-boot-starter/pom.xml index f7d4f7ee..0b1353c4 100644 --- a/nakadi-producer-spring-boot-starter/pom.xml +++ b/nakadi-producer-spring-boot-starter/pom.xml @@ -10,7 +10,7 @@ org.zalando nakadi-producer-reactor - 21.0.0 + 30.0.0-SNAPSHOT nakadi-producer-spring-boot-starter diff --git a/nakadi-producer-starter-spring-boot-3-test/pom.xml b/nakadi-producer-starter-spring-boot-3-test/pom.xml index 1935333b..0a65065d 100644 --- a/nakadi-producer-starter-spring-boot-3-test/pom.xml +++ b/nakadi-producer-starter-spring-boot-3-test/pom.xml @@ -10,7 +10,7 @@ org.zalando nakadi-producer-reactor - 21.0.0 + 30.0.0-SNAPSHOT diff --git a/nakadi-producer/pom.xml b/nakadi-producer/pom.xml index c75b67c8..e6eb274a 100644 --- a/nakadi-producer/pom.xml +++ b/nakadi-producer/pom.xml @@ -10,7 +10,7 @@ org.zalando nakadi-producer-reactor - 21.0.0 + 30.0.0-SNAPSHOT nakadi-producer diff --git a/pom.xml b/pom.xml index 89d59b81..7c509368 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ nakadi-producer-reactor org.zalando - 21.0.0 + 30.0.0-SNAPSHOT pom Nakadi Event Producer Reactor From f887f0ba42edfcb6eb64472e18ae15544b679947 Mon Sep 17 00:00:00 2001 From: Lucas Medeiros de Azevedo Date: Tue, 7 May 2024 16:39:27 +0200 Subject: [PATCH 5/9] Update README --- README.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7f8af037..9a1e17b1 100644 --- a/README.md +++ b/README.md @@ -43,10 +43,23 @@ You may of course always setup a fresh system with the newest version. ## Prerequisites -This library was tested with Java 11 (starting with 21.0.0), Spring Boot 2.5.6.RELEASE and Flyway 7. -It relies on an existing configured PostgreSQL DataSource. -**If you are still using Spring Boot 1.x, please use versions < 20.0.0, they are still actively maintained ([Documentation](https://github.com/zalando-nakadi/nakadi-producer-spring-boot-starter/tree/spring-boot-1)).** +Your Spring Boot version must be compatible with the version of this library you want to use. +| Spring Boot | nakadi-producer-spring-boot-starter | +|---|---| +| 3.x | >= 30.0.0 | +| 2.x | >= 20.0.0 but < 30.0.0 | +| 1.x | < 20.0.0 | + +Additionally, this library was tested with: + +| nakadi-producer-spring-boot-starter | Java | Spring Boot | Flyway | | +|---|---|---|---|---| +| 30.0.0 | 21 | 3.2.5.RELEASE | 9 || +| 20.0.0 | 11 | 2.5.6.RELEASE | 7 || +| 4.5.0 | 8 | 1.5.3.RELEASE | 4 |[Documentation](https://github.com/zalando-nakadi/nakadi-producer-spring-boot-starter/tree/spring-boot-1)| + +It relies on an existing configured PostgreSQL DataSource. This library also uses: * flyway-core @@ -466,7 +479,7 @@ We (the [maintainers](MAINTAINERS)) want to thank our main contributors: * Alexander Libin (@qlibin), who created a similar predecessor library (tarbela-producer-spring-boot-starter, now not public anymore), from which this one was forked. -* Lucas Medeiros de Azevedo (@wormangel), who added support for business events. +* Lucas Medeiros de Azevedo (@wormangel), who added support for business events and support for Spring Boot 3. * Benjamin Gehrels (@BGehrels), who co-maintained this project from its inception in 2017 until 2019, contributing many features and ideas. ### Contact From 7b712e73896b7dd5faf6e2a7acf26afcd368e63f Mon Sep 17 00:00:00 2001 From: Lucas Medeiros de Azevedo Date: Tue, 7 May 2024 17:00:10 +0200 Subject: [PATCH 6/9] Add GH action for CI build --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..d6455b1c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: CI build + +on: + pull_request: + branches: + - master +jobs: + build: + name: Maven build + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + + - name: Build with Maven + run: ./mvnw package -B -V From 0f9634308378613a2d3fdbffb8f10dd0c98130f5 Mon Sep 17 00:00:00 2001 From: Lucas Azevedo Date: Tue, 7 May 2024 17:37:54 +0200 Subject: [PATCH 7/9] Correct table of tested versions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a1e17b1..8869f7ae 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Additionally, this library was tested with: | nakadi-producer-spring-boot-starter | Java | Spring Boot | Flyway | | |---|---|---|---|---| | 30.0.0 | 21 | 3.2.5.RELEASE | 9 || -| 20.0.0 | 11 | 2.5.6.RELEASE | 7 || +| 21.0.0 | 11 | 2.5.6.RELEASE | 7 || | 4.5.0 | 8 | 1.5.3.RELEASE | 4 |[Documentation](https://github.com/zalando-nakadi/nakadi-producer-spring-boot-starter/tree/spring-boot-1)| It relies on an existing configured PostgreSQL DataSource. From 9ccf7ba83929280c324321ea706084595f796489 Mon Sep 17 00:00:00 2001 From: Lucas Medeiros de Azevedo Date: Mon, 13 May 2024 10:31:47 +0200 Subject: [PATCH 8/9] Attempt to fix flaky test --- .../src/test/java/org/zalando/nakadiproducer/LockingIT.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/LockingIT.java b/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/LockingIT.java index a152c301..6c06fc5f 100644 --- a/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/LockingIT.java +++ b/nakadi-producer-spring-boot-starter/src/test/java/org/zalando/nakadiproducer/LockingIT.java @@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.zalando.nakadiproducer.eventlog.EventLogWriter; import org.zalando.nakadiproducer.eventlog.impl.EventLog; +import org.zalando.nakadiproducer.eventlog.impl.EventLogRepository; import org.zalando.nakadiproducer.transmission.MockNakadiPublishingClient; import org.zalando.nakadiproducer.transmission.impl.EventTransmissionService; import org.zalando.nakadiproducer.transmission.impl.EventTransmitter; @@ -30,6 +31,9 @@ public class LockingIT extends BaseMockedExternalCommunicationIT { @Autowired private EventTransmitter eventTransmitter; + @Autowired + private EventLogRepository eventLogRepository; + @Autowired private EventTransmissionService eventTransmissionService; @@ -41,6 +45,7 @@ public class LockingIT extends BaseMockedExternalCommunicationIT { public void clearNakadiEvents() { eventTransmitter.sendEvents(); nakadiClient.clearSentEvents(); + eventLogRepository.deleteAll(); } @Test From c102bfc3adf1f42887f5401291c50657cf6d8bf3 Mon Sep 17 00:00:00 2001 From: Paul Ebermann Date: Mon, 13 May 2024 18:05:24 +0200 Subject: [PATCH 9/9] =?UTF-8?q?bump=20Nexus=20deploy=20plugin=201.6.7=20?= =?UTF-8?q?=E2=86=92=201.6.13=20in=20subprojects?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nakadi-producer-spring-boot-starter/pom.xml | 2 +- nakadi-producer/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nakadi-producer-spring-boot-starter/pom.xml b/nakadi-producer-spring-boot-starter/pom.xml index 0b1353c4..0cac4a3f 100644 --- a/nakadi-producer-spring-boot-starter/pom.xml +++ b/nakadi-producer-spring-boot-starter/pom.xml @@ -166,7 +166,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.7 + 1.6.13 true ossrh diff --git a/nakadi-producer/pom.xml b/nakadi-producer/pom.xml index e6eb274a..d96ff7c4 100644 --- a/nakadi-producer/pom.xml +++ b/nakadi-producer/pom.xml @@ -158,7 +158,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.7 + 1.6.13 true ossrh