Revert "fix(2.0): 所有 Kafka consumer 改为 fromBeginning: true 确保 full-reset 全量同步"
This reverts commit 534d4ce70c.
This commit is contained in:
parent
a41feb841f
commit
6b92ab0dd8
|
|
@ -120,12 +120,6 @@ CDC_CONSUMER_GROUPS=(
|
||||||
"auth-service-cdc-group"
|
"auth-service-cdc-group"
|
||||||
"auth-service-cdc-group-wallet"
|
"auth-service-cdc-group-wallet"
|
||||||
"mining-admin-service-cdc-group"
|
"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)
|
# 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({
|
await this.consumer.subscribe({
|
||||||
topics: Object.values(ACK_TOPICS),
|
topics: Object.values(ACK_TOPICS),
|
||||||
fromBeginning: true,
|
fromBeginning: false,
|
||||||
});
|
});
|
||||||
this.logger.log(`[SUBSCRIBE] Subscribed to ACK topics`);
|
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`);
|
this.logger.log(`[CONNECT] MPC Event Kafka consumer connected successfully`);
|
||||||
|
|
||||||
// Subscribe to MPC topics
|
// Subscribe to MPC topics
|
||||||
await this.consumer.subscribe({ topics: Object.values(MPC_TOPICS), fromBeginning: true });
|
await this.consumer.subscribe({ topics: Object.values(MPC_TOPICS), fromBeginning: false });
|
||||||
this.logger.log(`[SUBSCRIBE] Subscribed to MPC topics: ${Object.values(MPC_TOPICS).join(', ')}`);
|
this.logger.log(`[SUBSCRIBE] Subscribed to MPC topics: ${Object.values(MPC_TOPICS).join(', ')}`);
|
||||||
|
|
||||||
// Start consuming
|
// Start consuming
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ export class WithdrawalEventConsumerService implements OnModuleInit, OnModuleDes
|
||||||
|
|
||||||
await this.consumer.subscribe({
|
await this.consumer.subscribe({
|
||||||
topics: Object.values(WITHDRAWAL_TOPICS),
|
topics: Object.values(WITHDRAWAL_TOPICS),
|
||||||
fromBeginning: true,
|
fromBeginning: false,
|
||||||
});
|
});
|
||||||
this.logger.log(`[SUBSCRIBE] Subscribed to withdrawal topics`);
|
this.logger.log(`[SUBSCRIBE] Subscribed to withdrawal topics`);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ export class ContributionEventHandler implements OnModuleInit {
|
||||||
|
|
||||||
// 订阅多个 topic
|
// 订阅多个 topic
|
||||||
for (const topic of topics) {
|
for (const topic of topics) {
|
||||||
await this.consumer.subscribe({ topic, fromBeginning: true });
|
await this.consumer.subscribe({ topic, fromBeginning: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.consumer.run({
|
await this.consumer.run({
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ export class CdcConsumerService implements OnModuleInit, OnModuleDestroy {
|
||||||
|
|
||||||
await this.consumer.subscribe({
|
await this.consumer.subscribe({
|
||||||
topics: [walletTopic],
|
topics: [walletTopic],
|
||||||
fromBeginning: true, // full-reset 时从头开始同步
|
fromBeginning: false, // 不需要处理历史消息
|
||||||
});
|
});
|
||||||
this.logger.log(`Subscribed to topic: ${walletTopic}`);
|
this.logger.log(`Subscribed to topic: ${walletTopic}`);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ export class MarketMakerDepositConsumerService implements OnModuleInit, OnModule
|
||||||
|
|
||||||
await this.consumer.subscribe({
|
await this.consumer.subscribe({
|
||||||
topics: [topic],
|
topics: [topic],
|
||||||
fromBeginning: true,
|
fromBeginning: false,
|
||||||
});
|
});
|
||||||
this.logger.log(`Subscribed to topic: ${topic}`);
|
this.logger.log(`Subscribed to topic: ${topic}`);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue