Reduce Kafka publish latency for messages

This commit is contained in:
richjohnrambo
2026-09-07 11:33:50 +08:00
parent a56efd4454
commit 160d33c759
7 changed files with 26 additions and 8 deletions
+11
View File
@@ -30,6 +30,17 @@ func TestKafkaTopicsKeepOnlyMessageInternalAsyncTopics(t *testing.T) {
}
}
func TestNormalizeKafkaConfigUsesLowLatencyBatchTimeout(t *testing.T) {
cfg := kafkaConfig{}
normalizeKafkaConfig(&cfg)
if cfg.BatchTimeoutMS != 10 {
t.Fatalf("unexpected kafka batch timeout: %d", cfg.BatchTimeoutMS)
}
if cfg.MaxRetryCount != 3 {
t.Fatalf("unexpected kafka max retry count: %d", cfg.MaxRetryCount)
}
}
func TestEnqueueKafkaAuditEventPublishesCrossSystemEvent(t *testing.T) {
oldKafkaBus := kafkaBus
oldPublisher := publishKafkaAuditEventEnvelope