This commit is contained in:
zhx 2026-05-27 18:04:07 +08:00
parent e73e2f5ee8
commit 9fa6991ffd
2 changed files with 22 additions and 2 deletions

View File

@ -63,7 +63,7 @@ rocketmq:
enabled: true
topic: "hyapp_room_outbox"
producer_group: "hyapp-room-outbox-producer"
tencent_im_consumer_enabled: false
tencent_im_consumer_enabled: true
tencent_im_consumer_group: "hyapp-room-im-bridge"
consumer_max_reconsume_times: 16
treasure_open:
@ -73,7 +73,7 @@ rocketmq:
consumer_group: "hyapp-room-treasure-open"
consumer_max_reconsume_times: 16
outbox_worker:
# Docker 本地走 MQ避免本地统计链路验证时混入真实 IM 直投副作用
# Docker 和 testbox 走 MQroom-service 同进程启动 IM bridge consumer 补偿房间群消息
enabled: true
publish_mode: "mq"
poll_interval: "1s"

View File

@ -75,6 +75,26 @@ func TestLoadTencentExample(t *testing.T) {
}
}
func TestLoadDockerConfigStartsRoomIMBridgeWhenOutboxUsesMQ(t *testing.T) {
cfg, err := Load("../../configs/config.docker.yaml")
if err != nil {
t.Fatalf("Load docker config failed: %v", err)
}
if cfg.OutboxWorker.PublishMode != OutboxPublishModeMQ {
t.Fatalf("docker config should publish room outbox through MQ, got %q", cfg.OutboxWorker.PublishMode)
}
if !cfg.RocketMQ.RoomOutbox.Enabled {
t.Fatalf("docker config must enable room outbox MQ")
}
if !cfg.RocketMQ.RoomOutbox.TencentIMConsumerEnabled {
t.Fatalf("docker mq room outbox must start Tencent IM bridge consumer")
}
if !cfg.TencentIM.Enabled {
t.Fatalf("Tencent IM bridge consumer requires tencent_im.enabled")
}
}
func TestNormalizeRejectsUnknownOutboxRetryStrategy(t *testing.T) {
cfg := Default()
cfg.OutboxWorker.RetryStrategy = "exponential"