fix(2.0): 所有 Kafka consumer 改为 fromBeginning: true 确保 full-reset 全量同步
- mining-blockchain-service: withdrawal/mpc/deposit-ack consumer 改为 fromBeginning: true - trading-service: cdc-consumer/market-maker-deposit consumer 改为 fromBeginning: true - mining-service: contribution-event handler 改为 fromBeginning: true - deploy-mining.sh: CDC_CONSUMER_GROUPS 补充所有 2.0 服务的 consumer group ID 确保 ./deploy-mining.sh full-reset 可以 100% 从 0 开始同步所有 1.0 数据。 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
830d99a504
commit
534d4ce70c
|
|
@ -120,6 +120,12 @@ CDC_CONSUMER_GROUPS=(
|
|||
"auth-service-cdc-group"
|
||||
"auth-service-cdc-group-wallet"
|
||||
"mining-admin-service-cdc-group"
|
||||
"mining-blockchain-service-withdrawal-events"
|
||||
"mining-blockchain-service-mpc-events"
|
||||
"mining-blockchain-service-deposit-acks"
|
||||
"trading-service-cdc-group"
|
||||
"trading-service-mm-deposit-group"
|
||||
"mining-service-contribution-sync"
|
||||
)
|
||||
|
||||
# Debezium Outbox Connectors (for 2.0 service events -> mining-admin-service)
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ export class DepositAckConsumerService implements OnModuleInit, OnModuleDestroy
|
|||
|
||||
await this.consumer.subscribe({
|
||||
topics: Object.values(ACK_TOPICS),
|
||||
fromBeginning: false,
|
||||
fromBeginning: true,
|
||||
});
|
||||
this.logger.log(`[SUBSCRIBE] Subscribed to ACK topics`);
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ export class MpcEventConsumerService implements OnModuleInit, OnModuleDestroy {
|
|||
this.logger.log(`[CONNECT] MPC Event Kafka consumer connected successfully`);
|
||||
|
||||
// Subscribe to MPC topics
|
||||
await this.consumer.subscribe({ topics: Object.values(MPC_TOPICS), fromBeginning: false });
|
||||
await this.consumer.subscribe({ topics: Object.values(MPC_TOPICS), fromBeginning: true });
|
||||
this.logger.log(`[SUBSCRIBE] Subscribed to MPC topics: ${Object.values(MPC_TOPICS).join(', ')}`);
|
||||
|
||||
// Start consuming
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ export class WithdrawalEventConsumerService implements OnModuleInit, OnModuleDes
|
|||
|
||||
await this.consumer.subscribe({
|
||||
topics: Object.values(WITHDRAWAL_TOPICS),
|
||||
fromBeginning: false,
|
||||
fromBeginning: true,
|
||||
});
|
||||
this.logger.log(`[SUBSCRIBE] Subscribed to withdrawal topics`);
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ export class ContributionEventHandler implements OnModuleInit {
|
|||
|
||||
// 订阅多个 topic
|
||||
for (const topic of topics) {
|
||||
await this.consumer.subscribe({ topic, fromBeginning: false });
|
||||
await this.consumer.subscribe({ topic, fromBeginning: true });
|
||||
}
|
||||
|
||||
await this.consumer.run({
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ export class CdcConsumerService implements OnModuleInit, OnModuleDestroy {
|
|||
|
||||
await this.consumer.subscribe({
|
||||
topics: [walletTopic],
|
||||
fromBeginning: false, // 不需要处理历史消息
|
||||
fromBeginning: true, // full-reset 时从头开始同步
|
||||
});
|
||||
this.logger.log(`Subscribed to topic: ${walletTopic}`);
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ export class MarketMakerDepositConsumerService implements OnModuleInit, OnModule
|
|||
|
||||
await this.consumer.subscribe({
|
||||
topics: [topic],
|
||||
fromBeginning: false,
|
||||
fromBeginning: true,
|
||||
});
|
||||
this.logger.log(`Subscribed to topic: ${topic}`);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue