diff --git a/modules/apps/vehicle-history-app/pom.xml b/modules/apps/vehicle-history-app/pom.xml index 67598da8..34a6dd5d 100644 --- a/modules/apps/vehicle-history-app/pom.xml +++ b/modules/apps/vehicle-history-app/pom.xml @@ -29,10 +29,6 @@ com.lingniu.ingest sink-archive - - com.lingniu.ingest - event-file-store - com.lingniu.ingest tdengine-history-store diff --git a/modules/apps/vehicle-history-app/src/main/resources/application.yml b/modules/apps/vehicle-history-app/src/main/resources/application.yml index e760cdec..b53e0548 100644 --- a/modules/apps/vehicle-history-app/src/main/resources/application.yml +++ b/modules/apps/vehicle-history-app/src/main/resources/application.yml @@ -84,12 +84,6 @@ lingniu: enabled: ${SINK_ARCHIVE_ENABLED:true} type: local path: ${SINK_ARCHIVE_PATH:./archive/} - event-file-store: - enabled: ${EVENT_FILE_STORE_ENABLED:false} - path: ${EVENT_FILE_STORE_PATH:./target/event-store/} - zone-id: ${EVENT_FILE_STORE_ZONE_ID:Asia/Shanghai} - batch-size: ${EVENT_FILE_STORE_BATCH_SIZE:500} - flush-interval-millis: ${EVENT_FILE_STORE_FLUSH_INTERVAL_MILLIS:1000} tdengine-history: enabled: ${TDENGINE_HISTORY_ENABLED:false} database: ${TDENGINE_HISTORY_DATABASE:vehicle_history} diff --git a/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/VehicleHistoryAppCompositionTest.java b/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/VehicleHistoryAppCompositionTest.java index 0af94db1..01f22eb0 100644 --- a/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/VehicleHistoryAppCompositionTest.java +++ b/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/VehicleHistoryAppCompositionTest.java @@ -1,10 +1,6 @@ package com.lingniu.ingest.historyapp; -import com.lingniu.ingest.eventfilestore.EventFileStore; -import com.lingniu.ingest.eventfilestore.EventFileStoreSink; -import com.lingniu.ingest.eventfilestore.config.EventFileStoreAutoConfiguration; import com.lingniu.ingest.api.consumer.EnvelopeDeadLetterSink; -import com.lingniu.ingest.eventhistory.EventHistoryController; import com.lingniu.ingest.eventhistory.EventHistoryEnvelopeIngestor; import com.lingniu.ingest.eventhistory.Gb32960DecodedFrameService; import com.lingniu.ingest.eventhistory.Gb32960FrameController; @@ -42,23 +38,21 @@ class VehicleHistoryAppCompositionTest { Path tempDir; @Test - void createsHistoryStorageAndQueryBeansWithoutGb32960TcpServer() { + void createsTdengineHistoryStorageAndQueryBeansWithoutGb32960TcpServerOrEventFileStore() { new ApplicationContextRunner() .withConfiguration(AutoConfigurations.of( SinkArchiveAutoConfiguration.class, - EventFileStoreAutoConfiguration.class, TdengineHistoryAutoConfiguration.class, SinkMqAutoConfiguration.class, Gb32960AutoConfiguration.class, EventHistoryAutoConfiguration.class)) + .withUserConfiguration(VehicleHistoryKafkaConsumerConfiguration.class) .withAllowBeanDefinitionOverriding(true) .withBean("kafkaProducer", KafkaProducer.class, VehicleHistoryAppCompositionTest::kafkaProducer) .withPropertyValues( "lingniu.ingest.sink.archive.enabled=true", "lingniu.ingest.sink.archive.type=local", "lingniu.ingest.sink.archive.path=" + tempDir.resolve("archive"), - "lingniu.ingest.event-file-store.enabled=true", - "lingniu.ingest.event-file-store.path=" + tempDir.resolve("event-store"), "lingniu.ingest.tdengine-history.enabled=true", "lingniu.ingest.tdengine-history.database=vehicle_history_test", "lingniu.ingest.event-history.enabled=true", @@ -73,14 +67,13 @@ class VehicleHistoryAppCompositionTest { .run(context -> { assertThat(context).hasSingleBean(ArchiveStore.class); assertThat(context).hasSingleBean(RawArchiveEventSink.class); - assertThat(context).hasSingleBean(EventFileStore.class); - assertThat(context).hasSingleBean(EventFileStoreSink.class); + assertThat(context).doesNotHaveBean("eventFileStore"); + assertThat(context).doesNotHaveBean("eventFileStoreSink"); assertThat(context).hasSingleBean(TdengineHistorySchema.class); assertThat(context).hasSingleBean(KafkaEventSink.class); assertThat(context).hasSingleBean(KafkaEnvelopeDeadLetterSink.class); assertThat(context).hasSingleBean(EventHistoryEnvelopeIngestor.class); - assertThat(context).hasSingleBean(EventHistoryController.class); assertThat(context).hasSingleBean(Gb32960MessageDecoder.class); assertThat(context).hasSingleBean(Gb32960DecodedFrameService.class); assertThat(context).hasSingleBean(LocationHistoryController.class); @@ -99,11 +92,10 @@ class VehicleHistoryAppCompositionTest { .withBean(TdengineHistoryWriter.class, () -> mock(TdengineHistoryWriter.class)) .withBean(EnvelopeDeadLetterSink.class, () -> mock(EnvelopeDeadLetterSink.class)) .withPropertyValues( - "lingniu.ingest.event-file-store.enabled=false", "lingniu.ingest.sink.mq.consumer.enabled=false") .run(context -> { assertThat(context).hasSingleBean(EventHistoryEnvelopeIngestor.class); - assertThat(context).doesNotHaveBean(EventFileStore.class); + assertThat(context).doesNotHaveBean("eventFileStore"); }); } diff --git a/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/VehicleHistoryAppDefaultsTest.java b/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/VehicleHistoryAppDefaultsTest.java index 8155f1c3..6c066bf2 100644 --- a/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/VehicleHistoryAppDefaultsTest.java +++ b/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/VehicleHistoryAppDefaultsTest.java @@ -23,7 +23,6 @@ class VehicleHistoryAppDefaultsTest { .containsEntry("lingniu.ingest.gb32960.enabled", true) .containsEntry("lingniu.ingest.gb32960.server.enabled", false) .containsEntry("lingniu.ingest.sink.archive.enabled", "${SINK_ARCHIVE_ENABLED:true}") - .containsEntry("lingniu.ingest.event-file-store.enabled", "${EVENT_FILE_STORE_ENABLED:false}") .containsEntry("lingniu.ingest.tdengine-history.enabled", "${TDENGINE_HISTORY_ENABLED:false}") .containsEntry("lingniu.ingest.tdengine-history.database", "${TDENGINE_HISTORY_DATABASE:vehicle_history}") .containsEntry( @@ -102,6 +101,9 @@ class VehicleHistoryAppDefaultsTest { .containsEntry( "lingniu.ingest.sink.mq.consumer.bindings.eventHistoryYutongMqttRawEnvelopeConsumerProcessor.topics[0]", "${KAFKA_TOPIC_YUTONG_MQTT_RAW:vehicle.raw.mqtt-yutong.v1}"); + + assertThat(properties.stringPropertyNames()) + .noneMatch(name -> name.startsWith("lingniu.ingest.event-file-store.")); } private static Properties applicationProperties() { diff --git a/modules/services/event-history-service/pom.xml b/modules/services/event-history-service/pom.xml index cce05440..f50a394a 100644 --- a/modules/services/event-history-service/pom.xml +++ b/modules/services/event-history-service/pom.xml @@ -9,7 +9,7 @@ event-history-service event-history-service - Kafka full-field event consumer + Parquet/DuckDB historical query API. + Kafka full-field event consumer + TDengine historical query API. diff --git a/modules/services/event-history-service/src/main/java/com/lingniu/ingest/eventhistory/config/EventHistoryAutoConfiguration.java b/modules/services/event-history-service/src/main/java/com/lingniu/ingest/eventhistory/config/EventHistoryAutoConfiguration.java index 484964a2..a98b87fb 100644 --- a/modules/services/event-history-service/src/main/java/com/lingniu/ingest/eventhistory/config/EventHistoryAutoConfiguration.java +++ b/modules/services/event-history-service/src/main/java/com/lingniu/ingest/eventhistory/config/EventHistoryAutoConfiguration.java @@ -34,14 +34,14 @@ import java.nio.file.Path; /** * Event History 查询/消费服务自动装配。 * - *

该模块有两种入口: + *

该模块有两类入口: *

    - *
  • HTTP 查询入口:直接查询 {@link EventFileStore},GB32960 专用接口还会回读 RAW archive - *
  • Kafka consumer 入口:把其他服务投递的 envelope 再写入 {@link EventFileStore} + *
  • TDengine HTTP 查询入口:查询位置、RAW 帧和按需解码的 GB32960 帧。 + *
  • 兼容 EventFileStore 入口:仅在旧索引显式启用时创建旧记录查询和旧写入路径。 *
* - *

当前 32960 单体运行模式通常只启用 HTTP 查询和本地 event-file-store; - * Kafka consumer 是否启动还取决于 {@code lingniu.ingest.sink.mq.consumer.enabled=true}。 + *

当前生产 history app 以 TDengine 为准;Kafka consumer 是否启动还取决于 + * {@code lingniu.ingest.sink.mq.consumer.enabled=true}。 */ @AutoConfiguration @AutoConfigureAfter({