From 375ad78255579fba15b72512c9f807a1ae012975 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 06:59:02 +0000 Subject: [PATCH 1/3] fix(deps): bump org.springframework.boot:spring-boot-dependencies Bumps [org.springframework.boot:spring-boot-dependencies](https://github.com/spring-projects/spring-boot) from 3.3.2 to 3.3.3. - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.3.2...v3.3.3) --- updated-dependencies: - dependency-name: org.springframework.boot:spring-boot-dependencies dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- sda-commons-dependencies/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sda-commons-dependencies/build.gradle b/sda-commons-dependencies/build.gradle index 4c7ba12a..c51ce841 100644 --- a/sda-commons-dependencies/build.gradle +++ b/sda-commons-dependencies/build.gradle @@ -10,7 +10,7 @@ ext { awaitalityVersion = '4.2.0' bouncycastleVersion = '1.78.1' logbackContribVersion = '0.1.5' - springBootVersion = '3.3.2' + springBootVersion = '3.3.3' springCloudVersion = '2023.0.3' scalaVersion = '2.13.14' swaggerCoreVersion = '2.2.22' From 9435d40443eefeae167b0783fc872962cca06226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Siebahn?= Date: Fri, 23 Aug 2024 15:05:09 +0200 Subject: [PATCH 2/3] fix(kafka): replace deprecated method call --- .../spring/boot/kafka/SdaKafkaConsumerConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sda-commons-starter-kafka/src/main/java/org/sdase/commons/spring/boot/kafka/SdaKafkaConsumerConfiguration.java b/sda-commons-starter-kafka/src/main/java/org/sdase/commons/spring/boot/kafka/SdaKafkaConsumerConfiguration.java index 86ccc83d..c4ca9366 100644 --- a/sda-commons-starter-kafka/src/main/java/org/sdase/commons/spring/boot/kafka/SdaKafkaConsumerConfiguration.java +++ b/sda-commons-starter-kafka/src/main/java/org/sdase/commons/spring/boot/kafka/SdaKafkaConsumerConfiguration.java @@ -201,7 +201,7 @@ private ExponentialBackOffWithMaxRetries createDefaultRetryBackOff() { ConcurrentKafkaListenerContainerFactory factory = new ConcurrentKafkaListenerContainerFactory<>(); factory.setConsumerFactory( - new DefaultKafkaConsumerFactory<>(kafkaProperties.buildConsumerProperties())); + new DefaultKafkaConsumerFactory<>(kafkaProperties.buildConsumerProperties(null))); factory.setRecordMessageConverter(new ByteArrayJsonMessageConverter(objectMapper)); factory.getContainerProperties().setAckMode(AckMode.RECORD); // Please note that ConversionExceptions like mapping exception won't be retried and directly From 154507440d6455e137ab61abe4db7ecd97a653b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Siebahn?= Date: Fri, 23 Aug 2024 15:51:41 +0200 Subject: [PATCH 3/3] fix(logging): accept some non-json Logs before app start --- .../boot/web/logging/JsonLoggingTest.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/sda-commons-starter-web/src/test/java/org/sdase/commons/spring/boot/web/logging/JsonLoggingTest.java b/sda-commons-starter-web/src/test/java/org/sdase/commons/spring/boot/web/logging/JsonLoggingTest.java index ec72bb12..c8276cbe 100644 --- a/sda-commons-starter-web/src/test/java/org/sdase/commons/spring/boot/web/logging/JsonLoggingTest.java +++ b/sda-commons-starter-web/src/test/java/org/sdase/commons/spring/boot/web/logging/JsonLoggingTest.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.util.List; import java.util.Map; +import java.util.Set; import org.assertj.core.api.InstanceOfAssertFactories; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -69,7 +70,7 @@ void shouldLogJsonUsingDifferentTimeStampFormat(CapturedOutput output) assertThat(output).asString().contains("Started JsonLoggingTest.LoggingTestApp"); for (String json : jsonLines(output)) { Map jsonObjectMap = - new ObjectMapper().readValue(json, new TypeReference>() {}); + new ObjectMapper().readValue(json, new TypeReference<>() {}); assertThat(jsonObjectMap).containsKeys("level", "logger", "timestamp", "message"); assertThat(jsonObjectMap.get("timestamp")) @@ -92,8 +93,31 @@ private List jsonLines(CapturedOutput capturedOutput) { } private List onlyConfigurableLogLines(List logLines) { + + // intentional in Spring Boot "to aid problem diagnosis", see + // https://github.com/spring-projects/spring-boot/issues/42006#issuecomment-2306512921 + var intentionalSpringLogs = + Set.of( + "INFO in ch.qos.logback.core.joran", + "INFO in ch.qos.logback.core.model.processor.ConversionRuleModelHandler", + "INFO in ch.qos.logback.core.model.processor.ModelInterpretationContext", + "INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler", + "INFO in ch.qos.logback.classic.jul.LevelChangePropagator", + "INFO in ch.qos.logback.core.model.processor.AppenderModelHandler", + "INFO in ch.qos.logback.classic.model.processor.RootLoggerModelHandler", + "INFO in ch.qos.logback.core.model.processor.AppenderRefModelHandler", + "INFO in ch.qos.logback.core.model.processor.DefaultProcessor", + "INFO in org.springframework.boot.logging.logback.SpringBootJoranConfigurator"); + return logLines.stream() // Logs that are written before any configuration is possible may be filtered here. + .filter(l -> intentionalSpringLogs.stream().noneMatch(l::contains)) + // fixed in Spring Boot, not released yet, see + // https://github.com/spring-projects/spring-boot/commit/aea45b5013298dd6c970be3b7149d4390317baee + // this should be removed some day + .filter(l -> !l.contains("WARN in ch.qos.logback.core.joran.action.ConversionRuleAction")) + // logs before configuration end with a blank line + .filter(l -> !l.isEmpty()) .toList(); }