From 15c57c33b9a41d0bc669bb0fedf70056187ff793 Mon Sep 17 00:00:00 2001 From: lingniu Date: Wed, 1 Jul 2026 15:12:56 +0800 Subject: [PATCH] chore: keep legacy xinda kafka only --- .../src/main/resources/application.yml | 2 +- .../xindapushapp/XindaPushAppDefaultsTest.java | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/apps/xinda-push-app/src/main/resources/application.yml b/modules/apps/xinda-push-app/src/main/resources/application.yml index 775c4d84..3da42635 100644 --- a/modules/apps/xinda-push-app/src/main/resources/application.yml +++ b/modules/apps/xinda-push-app/src/main/resources/application.yml @@ -62,7 +62,7 @@ lingniu: initialize-schema: ${VEHICLE_IDENTITY_MYSQL_INITIALIZE_SCHEMA:true} sink: kafka: - enabled: ${KAFKA_ENABLED:true} + enabled: true bootstrap-servers: ${KAFKA_BROKERS:114.55.58.251:9092} compression-type: zstd linger-ms: 20 diff --git a/modules/apps/xinda-push-app/src/test/java/com/lingniu/ingest/xindapushapp/XindaPushAppDefaultsTest.java b/modules/apps/xinda-push-app/src/test/java/com/lingniu/ingest/xindapushapp/XindaPushAppDefaultsTest.java index ca28d5e5..e8d118fe 100644 --- a/modules/apps/xinda-push-app/src/test/java/com/lingniu/ingest/xindapushapp/XindaPushAppDefaultsTest.java +++ b/modules/apps/xinda-push-app/src/test/java/com/lingniu/ingest/xindapushapp/XindaPushAppDefaultsTest.java @@ -4,6 +4,8 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.config.YamlPropertiesFactoryBean; import org.springframework.core.io.ClassPathResource; +import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.Properties; import static org.assertj.core.api.Assertions.assertThat; @@ -11,7 +13,7 @@ import static org.assertj.core.api.Assertions.assertThat; class XindaPushAppDefaultsTest { @Test - void applicationDefaultsKeepXindaPushAsKafkaProducerOnly() { + void applicationDefaultsKeepXindaPushAsKafkaProducerOnly() throws IOException { Properties properties = applicationProperties(); assertThat(properties) @@ -26,7 +28,7 @@ class XindaPushAppDefaultsTest { .containsEntry("lingniu.ingest.xinda-push.port", "${XINDA_PUSH_PORT:10100}") .containsEntry("lingniu.ingest.xinda-push.username", "${XINDA_PUSH_USERNAME:}") .containsEntry("lingniu.ingest.xinda-push.subscribe-msg-ids[0]", "${XINDA_PUSH_MSG_ID_LOCATION:0200}") - .containsEntry("lingniu.ingest.sink.kafka.enabled", "${KAFKA_ENABLED:true}") + .containsEntry("lingniu.ingest.sink.kafka.enabled", true) .containsEntry("lingniu.ingest.sink.kafka.consumer.enabled", false) .containsEntry("lingniu.ingest.sink.kafka.topics.realtime", "${KAFKA_TOPIC_XINDA_PUSH_EVENT:vehicle.event.xinda-push.v1}") .containsEntry("lingniu.ingest.sink.kafka.topics.raw-archive", "${KAFKA_TOPIC_XINDA_PUSH_RAW:vehicle.raw.xinda-push.v1}") @@ -39,6 +41,9 @@ class XindaPushAppDefaultsTest { .containsEntry("lingniu.ingest.event-history.enabled", false) .containsEntry("lingniu.ingest.vehicle-state.enabled", false) .containsEntry("lingniu.ingest.vehicle-stat.enabled", false); + + assertThat(applicationYaml()) + .doesNotContain("KAFKA_ENABLED"); } private static Properties applicationProperties() { @@ -50,4 +55,9 @@ class XindaPushAppDefaultsTest { assertThat(properties).isNotNull(); return properties; } + + private static String applicationYaml() throws IOException { + return new String(new ClassPathResource("application.yml").getInputStream().readAllBytes(), + StandardCharsets.UTF_8); + } }