chore: remove xinda ingestion modules
This commit is contained in:
@@ -119,27 +119,34 @@ class MavenModuleProfileTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void xindaIsLegacyOnlyAndOutsideDefaultProductionReactor() throws Exception {
|
||||
void xindaModulesAreRemovedFromBuildSurface() throws Exception {
|
||||
Document pom = rootPom();
|
||||
String rootPomText = Files.readString(repositoryRoot().resolve("pom.xml"));
|
||||
|
||||
assertThat(defaultModules(pom))
|
||||
.doesNotContain("modules/inbound/inbound-xinda-push")
|
||||
.doesNotContain("modules/apps/xinda-push-app");
|
||||
|
||||
assertThat(profileModules(pom, "legacy-xinda"))
|
||||
.containsExactly(
|
||||
"modules/inbound/inbound-xinda-push",
|
||||
"modules/apps/xinda-push-app");
|
||||
.as("xinda is deleted, not hidden behind an opt-in profile")
|
||||
.isEmpty();
|
||||
assertThat(Files.exists(repositoryRoot().resolve("modules/inbound/inbound-xinda-push")))
|
||||
.isFalse();
|
||||
assertThat(Files.exists(repositoryRoot().resolve("modules/apps/xinda-push-app")))
|
||||
.isFalse();
|
||||
assertThat(rootPomText)
|
||||
.doesNotContain("legacy-xinda")
|
||||
.doesNotContain("inbound-xinda-push")
|
||||
.doesNotContain("xinda-push-app");
|
||||
}
|
||||
|
||||
@Test
|
||||
void privateLingniuRepositoryIsScopedToLegacyXindaProfile() throws Exception {
|
||||
void privateLingniuRepositoryIsRemovedWithXinda() throws Exception {
|
||||
Document pom = rootPom();
|
||||
|
||||
assertThat(repositoryIds(pom.getDocumentElement()))
|
||||
.doesNotContain("lingniu-nexus");
|
||||
assertThat(profileRepositoryIds(pom, "legacy-xinda"))
|
||||
.containsExactly("lingniu-nexus");
|
||||
.isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -167,7 +174,7 @@ class MavenModuleProfileTest {
|
||||
assertThat(profileDependencyManagementArtifacts(pom, "optional-event-file-store"))
|
||||
.isEmpty();
|
||||
assertThat(profileDependencyManagementArtifacts(pom, "legacy-xinda"))
|
||||
.containsExactly("inbound-xinda-push", "xinda-push-app");
|
||||
.isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -472,12 +479,12 @@ class MavenModuleProfileTest {
|
||||
String decisions = Files.readString(repositoryRoot().resolve("DECISIONS.md"));
|
||||
|
||||
assertThat(decisions)
|
||||
.contains("## ADR-004 信达 Push:Legacy only")
|
||||
.contains("## ADR-004 信达 Push:Removed")
|
||||
.contains("## ADR-006 部署形态:GB32960 三应用拆分\n- **Status**: Superseded by ADR-011")
|
||||
.contains("## ADR-011 默认生产面:三协议接入 + 历史 + 统计")
|
||||
.contains("## ADR-012 JSATL12 附件上传:Optional only")
|
||||
.contains("GB32960、JT808、Yutong MQTT、vehicle-history-app、vehicle-analytics-app")
|
||||
.contains("Xinda Push 仅保留在 `legacy-xinda` profile")
|
||||
.contains("Xinda Push 源码、Maven profile、Woodpecker 镜像发布和历史消费绑定全部移除")
|
||||
.contains("JSATL12 仅保留在 `optional-attachments` profile")
|
||||
.contains("vehicle-state-service 仅保留在 `optional-latest-state` profile")
|
||||
.contains("raw-archive-store 原型已删除")
|
||||
@@ -486,6 +493,7 @@ class MavenModuleProfileTest {
|
||||
.doesNotContain("event-file-store")
|
||||
.doesNotContain("optional-event-file-store")
|
||||
.doesNotContain("optional-raw-archive-store")
|
||||
.doesNotContain("legacy-xinda")
|
||||
.doesNotContain("## ADR-004 信达 Push:保留模块但彻底重写\n- **Status**: Accepted")
|
||||
.doesNotContain("CI/CD 分别构建三个镜像")
|
||||
.doesNotContain("Spring Boot 3.4.x");
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.lingniu.ingest</groupId>
|
||||
<artifactId>lingniu-vehicle-ingest</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>xinda-push-app</artifactId>
|
||||
<name>xinda-push-app</name>
|
||||
<description>Xinda Push ingress runtime: platform push client, frame parse, identity mapping, Kafka production, and raw archive.</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.lingniu.ingest</groupId>
|
||||
<artifactId>ingest-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lingniu.ingest</groupId>
|
||||
<artifactId>observability</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lingniu.ingest</groupId>
|
||||
<artifactId>vehicle-identity</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lingniu.ingest</groupId>
|
||||
<artifactId>inbound-xinda-push</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lingniu.ingest</groupId>
|
||||
<artifactId>sink-kafka</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lingniu.ingest</groupId>
|
||||
<artifactId>sink-archive</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>xinda-push-app</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<jvmArguments>--sun-misc-unsafe-memory-access=allow</jvmArguments>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
<goal>build-info</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.lingniu.ingest.xindapushapp;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication(scanBasePackages = "com.lingniu.ingest")
|
||||
public class XindaPushApplication {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(XindaPushApplication.class);
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
SpringApplication.run(XindaPushApplication.class, args);
|
||||
} catch (Throwable t) {
|
||||
log.error("Xinda Push ingest application failed to start, forcing JVM exit", t);
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
spring:
|
||||
application:
|
||||
name: xinda-push-app
|
||||
config:
|
||||
import:
|
||||
- optional:nacos:${spring.application.name}.${NACOS_CONFIG_FILE_EXTENSION:yml}?group=${NACOS_GROUP:DEFAULT_GROUP}&refreshEnabled=${NACOS_REFRESH_ENABLED:true}
|
||||
cloud:
|
||||
nacos:
|
||||
config:
|
||||
enabled: ${NACOS_CONFIG_ENABLED:true}
|
||||
server-addr: ${NACOS_SERVER_ADDR:127.0.0.1:8848}
|
||||
namespace: ${NACOS_NAMESPACE:}
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
file-extension: ${NACOS_CONFIG_FILE_EXTENSION:yml}
|
||||
username: ${NACOS_USERNAME:}
|
||||
password: ${NACOS_PASSWORD:}
|
||||
threads:
|
||||
virtual:
|
||||
enabled: true
|
||||
|
||||
server:
|
||||
port: ${HTTP_PORT:20600}
|
||||
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
path: /swagger-ui.html
|
||||
api-docs:
|
||||
path: /v3/api-docs
|
||||
|
||||
lingniu:
|
||||
ingest:
|
||||
xinda-push:
|
||||
enabled: ${XINDA_PUSH_ENABLED:false}
|
||||
host: ${XINDA_PUSH_HOST:}
|
||||
port: ${XINDA_PUSH_PORT:10100}
|
||||
username: ${XINDA_PUSH_USERNAME:}
|
||||
password: ${XINDA_PUSH_PASSWORD:}
|
||||
client-desc: ${XINDA_PUSH_CLIENT_DESC:lingniu-ingest}
|
||||
subscribe-msg-ids:
|
||||
- ${XINDA_PUSH_MSG_ID_LOCATION:0200}
|
||||
- ${XINDA_PUSH_MSG_ID_ALARM:0300}
|
||||
- ${XINDA_PUSH_MSG_ID_PASSTHROUGH:0401}
|
||||
reconnect-interval-sec: ${XINDA_PUSH_RECONNECT_INTERVAL_SEC:5}
|
||||
pipeline:
|
||||
disruptor:
|
||||
ring-buffer-size: ${PIPELINE_RING_BUFFER_SIZE:131072}
|
||||
wait-strategy: ${PIPELINE_WAIT_STRATEGY:yielding}
|
||||
producer-type: multi
|
||||
dedup:
|
||||
enabled: true
|
||||
cache-size: 200000
|
||||
ttl-seconds: 600
|
||||
rate-limit:
|
||||
per-vin-qps: 50
|
||||
identity:
|
||||
store: ${VEHICLE_IDENTITY_STORE:mysql}
|
||||
mysql:
|
||||
jdbc-url: ${VEHICLE_IDENTITY_MYSQL_JDBC_URL:jdbc:mysql://127.0.0.1:3306/lingniu_vehicle?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai}
|
||||
username: ${VEHICLE_IDENTITY_MYSQL_USERNAME:root}
|
||||
password: ${VEHICLE_IDENTITY_MYSQL_PASSWORD:}
|
||||
table-name: ${VEHICLE_IDENTITY_MYSQL_TABLE:vehicle_identity_bindings}
|
||||
initialize-schema: ${VEHICLE_IDENTITY_MYSQL_INITIALIZE_SCHEMA:true}
|
||||
sink:
|
||||
kafka:
|
||||
enabled: true
|
||||
bootstrap-servers: ${KAFKA_BROKERS:114.55.58.251:9092}
|
||||
compression-type: zstd
|
||||
linger-ms: 20
|
||||
batch-size: 65536
|
||||
acks: all
|
||||
enable-idempotence: true
|
||||
node-id: ${KAFKA_NODE_ID:xinda-push-local}
|
||||
topics:
|
||||
realtime: ${KAFKA_TOPIC_XINDA_PUSH_EVENT:vehicle.event.xinda-push.v1}
|
||||
location: ${KAFKA_TOPIC_XINDA_PUSH_EVENT:vehicle.event.xinda-push.v1}
|
||||
alarm: ${KAFKA_TOPIC_XINDA_PUSH_EVENT:vehicle.event.xinda-push.v1}
|
||||
session: ${KAFKA_TOPIC_XINDA_PUSH_EVENT:vehicle.event.xinda-push.v1}
|
||||
media-meta: ${KAFKA_TOPIC_MEDIA_META:vehicle.media.meta.v1}
|
||||
raw-archive: ${KAFKA_TOPIC_XINDA_PUSH_RAW:vehicle.raw.xinda-push.v1}
|
||||
dlq: ${KAFKA_TOPIC_XINDA_PUSH_DLQ:vehicle.dlq.xinda-push.v1}
|
||||
consumer:
|
||||
enabled: false
|
||||
archive:
|
||||
enabled: ${SINK_ARCHIVE_ENABLED:true}
|
||||
type: local
|
||||
path: ${SINK_ARCHIVE_PATH:./archive/}
|
||||
event-file-store:
|
||||
enabled: false
|
||||
event-history:
|
||||
enabled: false
|
||||
vehicle-state:
|
||||
enabled: false
|
||||
vehicle-stat:
|
||||
enabled: false
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info,metrics,prometheus,env
|
||||
health:
|
||||
redis:
|
||||
enabled: ${MANAGEMENT_HEALTH_REDIS_ENABLED:false}
|
||||
metrics:
|
||||
tags:
|
||||
application: xinda-push-app
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: INFO
|
||||
com.lingniu.ingest: INFO
|
||||
@@ -1,69 +0,0 @@
|
||||
package com.lingniu.ingest.xindapushapp;
|
||||
|
||||
import com.lingniu.ingest.core.config.IngestCoreAutoConfiguration;
|
||||
import com.lingniu.ingest.identity.config.VehicleIdentityAutoConfiguration;
|
||||
import com.lingniu.ingest.inbound.xinda.XindaPushClient;
|
||||
import com.lingniu.ingest.inbound.xinda.XindaPushEventMapper;
|
||||
import com.lingniu.ingest.inbound.xinda.XindaPushRealtimeHandler;
|
||||
import com.lingniu.ingest.inbound.xinda.config.XindaPushAutoConfiguration;
|
||||
import com.lingniu.ingest.sink.archive.ArchiveStore;
|
||||
import com.lingniu.ingest.sink.archive.RawArchiveEventSink;
|
||||
import com.lingniu.ingest.sink.archive.config.SinkArchiveAutoConfiguration;
|
||||
import com.lingniu.ingest.sink.kafka.KafkaEnvelopeDeadLetterSink;
|
||||
import com.lingniu.ingest.sink.kafka.KafkaEventSink;
|
||||
import com.lingniu.ingest.sink.kafka.KafkaSinkAutoConfiguration;
|
||||
import org.apache.kafka.clients.producer.KafkaProducer;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
class XindaPushAppCompositionTest {
|
||||
|
||||
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
||||
.withConfiguration(AutoConfigurations.of(
|
||||
IngestCoreAutoConfiguration.class,
|
||||
VehicleIdentityAutoConfiguration.class,
|
||||
KafkaSinkAutoConfiguration.class,
|
||||
SinkArchiveAutoConfiguration.class,
|
||||
XindaPushAutoConfiguration.class))
|
||||
.withAllowBeanDefinitionOverriding(true)
|
||||
.withBean("kafkaProducer", KafkaProducer.class, XindaPushAppCompositionTest::kafkaProducer)
|
||||
.withPropertyValues(
|
||||
"lingniu.ingest.xinda-push.enabled=true",
|
||||
"lingniu.ingest.xinda-push.host=127.0.0.1",
|
||||
"lingniu.ingest.xinda-push.port=10100",
|
||||
"lingniu.ingest.xinda-push.username=test",
|
||||
"lingniu.ingest.xinda-push.password=test",
|
||||
"lingniu.ingest.identity.store=mysql",
|
||||
"lingniu.ingest.identity.mysql.initialize-schema=false",
|
||||
"lingniu.ingest.sink.kafka.enabled=true",
|
||||
"lingniu.ingest.sink.kafka.bootstrap-servers=localhost:9092",
|
||||
"lingniu.ingest.sink.kafka.consumer.enabled=false",
|
||||
"lingniu.ingest.sink.archive.enabled=true",
|
||||
"lingniu.ingest.sink.archive.path=target/test-archive-xinda",
|
||||
"lingniu.ingest.event-file-store.enabled=false",
|
||||
"lingniu.ingest.event-history.enabled=false",
|
||||
"lingniu.ingest.vehicle-state.enabled=false",
|
||||
"lingniu.ingest.vehicle-stat.enabled=false");
|
||||
|
||||
@Test
|
||||
void createsXindaPushIngressAndKafkaSinksWithoutHistoryStorage() {
|
||||
contextRunner.run(context -> {
|
||||
assertThat(context).hasSingleBean(XindaPushClient.class);
|
||||
assertThat(context).hasSingleBean(XindaPushEventMapper.class);
|
||||
assertThat(context).hasSingleBean(XindaPushRealtimeHandler.class);
|
||||
assertThat(context).hasSingleBean(KafkaEventSink.class);
|
||||
assertThat(context).hasSingleBean(KafkaEnvelopeDeadLetterSink.class);
|
||||
assertThat(context).hasSingleBean(ArchiveStore.class);
|
||||
assertThat(context).hasSingleBean(RawArchiveEventSink.class);
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private static KafkaProducer<String, byte[]> kafkaProducer() {
|
||||
return mock(KafkaProducer.class);
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package com.lingniu.ingest.xindapushapp;
|
||||
|
||||
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;
|
||||
|
||||
class XindaPushAppDefaultsTest {
|
||||
|
||||
@Test
|
||||
void applicationDefaultsKeepXindaPushAsKafkaProducerOnly() throws IOException {
|
||||
Properties properties = applicationProperties();
|
||||
|
||||
assertThat(properties)
|
||||
.containsEntry("spring.application.name", "xinda-push-app")
|
||||
.containsEntry(
|
||||
"spring.config.import[0]",
|
||||
"optional:nacos:${spring.application.name}.${NACOS_CONFIG_FILE_EXTENSION:yml}?group=${NACOS_GROUP:DEFAULT_GROUP}&refreshEnabled=${NACOS_REFRESH_ENABLED:true}")
|
||||
.containsEntry("spring.cloud.nacos.config.server-addr", "${NACOS_SERVER_ADDR:127.0.0.1:8848}")
|
||||
.containsEntry("server.port", "${HTTP_PORT:20600}")
|
||||
.containsEntry("lingniu.ingest.xinda-push.enabled", "${XINDA_PUSH_ENABLED:false}")
|
||||
.containsEntry("lingniu.ingest.xinda-push.host", "${XINDA_PUSH_HOST:}")
|
||||
.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", 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}")
|
||||
.containsEntry("lingniu.ingest.sink.kafka.topics.dlq", "${KAFKA_TOPIC_XINDA_PUSH_DLQ:vehicle.dlq.xinda-push.v1}")
|
||||
.containsEntry("lingniu.ingest.identity.store", "${VEHICLE_IDENTITY_STORE:mysql}")
|
||||
.containsEntry("lingniu.ingest.identity.mysql.table-name",
|
||||
"${VEHICLE_IDENTITY_MYSQL_TABLE:vehicle_identity_bindings}")
|
||||
.containsEntry("lingniu.ingest.sink.archive.enabled", "${SINK_ARCHIVE_ENABLED:true}")
|
||||
.containsEntry("lingniu.ingest.event-file-store.enabled", false)
|
||||
.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() {
|
||||
YamlPropertiesFactoryBean factory = new YamlPropertiesFactoryBean();
|
||||
factory.setResources(new ClassPathResource("application.yml"));
|
||||
|
||||
Properties properties = factory.getObject();
|
||||
|
||||
assertThat(properties).isNotNull();
|
||||
return properties;
|
||||
}
|
||||
|
||||
private static String applicationYaml() throws IOException {
|
||||
return new String(new ClassPathResource("application.yml").getInputStream().readAllBytes(),
|
||||
StandardCharsets.UTF_8);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user