refactor(shared-ts,iam,core-edu,content,msg): remove outbox polling publisher

M8: Debezium CDC now handles outbox table to Kafka (ADR-032)

- Remove OutboxPublisher class from shared-ts

- Remove publisher from iam/core-edu/content/msg lifecycle and modules

- OutboxService retained for transactional outbox table writes

- Debezium monitors binlog and pushes to Kafka automatically
This commit is contained in:
SpecialX
2026-07-15 01:27:45 +08:00
parent a3f4fd013e
commit 47a062606f
16 changed files with 34 additions and 1227 deletions

View File

@@ -15,11 +15,7 @@ import { GraphqlModule } from "./graphql/graphql.module.js";
import { RouterAuthGuard } from "./graphql/router-auth.guard.js";
import { OutboxModule } from "@edu/shared-ts/outbox";
import { getDbInstance } from "./config/database.js";
import {
getKafkaProducer,
connectKafkaProducer,
IAM_KAFKA_TOPICS,
} from "./config/kafka.js";
import { connectKafkaProducer, IAM_KAFKA_TOPICS } from "./config/kafka.js";
/**
* IAM 根模块v2.1)。
@@ -42,13 +38,9 @@ import {
config: {
tableName: "iam_outbox",
kafkaTopic: IAM_KAFKA_TOPICS.USER_EVENTS,
pollIntervalMs: 1000,
batchSize: 20,
maxRetryCount: 5,
retryBackoffMs: 1000,
},
db: getDbInstance(),
kafkaProducer: getKafkaProducer(),
}),
],
providers: [
@@ -61,9 +53,8 @@ export class AppModule implements NestModule, OnModuleInit {
private readonly logger = new Logger(AppModule.name);
async onModuleInit(): Promise<void> {
// 连接 Kafka producerOutbox 投递前置依赖
// v2.1OutboxPublisher 轮询线程将被废弃M8由 Debezium 接管投递
// 此处保留 Kafka producer 连接用于其他场景(如直接发事件)
// 连接 Kafka producer健康检查 /healthz 依赖 producer 探活
// v2.1M8OutboxPublisher 轮询线程已移除outbox 投递由 Debezium CDC 接管
try {
await connectKafkaProducer();
this.logger.log("Kafka producer connected");