hyapp-server/services/room-service/configs/config.tencent.example.yaml
zhx ec35fcad5e room_outbox 增加 delivered 历史事件定期清理并移除重复索引
- outbox_worker.retention 配置块(默认关闭,max_age<24h 拒绝启动)
- 清理走预留的 idx_room_outbox_retention 索引,先选主键再小批量 DELETE
- 移除与 idx_room_outbox_pending 完全重复的 idx_room_outbox_retry,
  auto_migrate=true 时 Migrate 自动 DROP
- 开启清理前需和数据侧确认保留窗口覆盖统计重放/补数工具

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 01:12:25 +08:00

111 lines
4.0 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

service_name: room-service
environment: prod
node_id: "room-node-prod-1"
log:
level: info
format: json
include_request_body: false
include_response_body: false
max_payload_bytes: 2048
grpc_addr: ":13001"
advertise_addr: "ROOM_NODE_PRIVATE_IP_OR_DNS:13001"
health_http_addr: ":13101"
node_registry_ttl: "30s"
node_registry_heartbeat_interval: "10s"
owner_forward_timeout: "2s"
lease_ttl: "10s"
rank_limit: 20
snapshot_every_n: 10
wallet_service_addr: "wallet-service.internal:13004"
activity_service_addr: "activity-service.internal:13006"
robot_service_addr: "robot-service.internal:13011"
user_service_addr: "user-service.internal:13005"
tencent_im:
# 线上开启后,腾讯云 IM 建群和房间系统消息都由 room_outbox worker 异步投递。
enabled: true
# 腾讯云 IM 应用 ID必须和 gateway-service 使用同一个 SDKAppID。
sdk_app_id: 1400000000
# 腾讯云 IM SDKSecretKey只允许写在线上密钥系统或私有配置中。
secret_key: "TENCENT_IM_SECRET_KEY"
# 腾讯云 IM App 管理员账号,用于服务端 REST API。
admin_identifier: "administrator"
# 管理员 REST API UserSig 有效期。
admin_user_sig_ttl: "24h"
# REST API 区域域名;这里用新加坡示例,实际按腾讯云 IM 应用区域填写。
endpoint: "adminapisgp.im.qcloud.com"
# 语音房默认用 ChatRoom 保留基础群历史;改 AVChatRoom 前要确认历史和人数语义。
group_type: "ChatRoom"
# outbox worker 单次公网调用超时。
request_timeout: "5s"
tencent_rtc:
# 线上开启后,平台封禁会同步把用户从 TRTC 字符串房间踢出。
enabled: true
# 必须和 gateway-service tencent_rtc.sdk_app_id 使用同一个 TRTC 应用。
sdk_app_id: 1400000000
# 腾讯云 API 3.0 访问密钥,只允许来自线上密钥系统或私有配置。
secret_id: "TENCENT_CLOUD_SECRET_ID"
secret_key: "TENCENT_CLOUD_SECRET_KEY"
region: "ap-guangzhou"
endpoint: "trtc.tencentcloudapi.com"
request_timeout: "5s"
mysql_dsn: "USER:PASSWORD@tcp(TENCENT_CDB_HOST:3306)/hyapp_room?parseTime=true&charset=utf8mb4&loc=UTC&tls=false"
mysql_max_open_conns: 80
mysql_max_idle_conns: 20
mysql_auto_migrate: false
redis_addr: "TENCENT_REDIS_HOST:6379"
redis_password: "TENCENT_REDIS_PASSWORD"
redis_db: 0
lucky_gift_send_lock_ttl: "5s"
presence_stale_after: "2m"
presence_stale_scan_interval: "30s"
mic_publish_timeout: "15s"
mic_publish_scan_interval: "1s"
room_rocket_launch_scan_interval: "1s"
room_list_cache_refresh_interval: "5m"
rocketmq:
# 线上建议开启room_outbox 只投 MQactivity/notice/IM bridge 各自用 consumer group 解耦消费。
enabled: true
name_servers:
- "TENCENT_ROCKETMQ_NAMESERVER:9876"
name_server_domain: ""
access_key: "TENCENT_ROCKETMQ_ACCESS_KEY"
secret_key: "TENCENT_ROCKETMQ_SECRET_KEY"
namespace: "hyapp-prod"
send_timeout: "3s"
retry: 2
room_outbox:
enabled: true
topic: "hyapp_room_outbox"
producer_group: "hyapp-room-outbox-producer"
rocket_launch:
enabled: true
topic: "hyapp_room_rocket_launch"
producer_group: "hyapp-room-rocket-launch-producer"
consumer_group: "hyapp-room-rocket-launch"
consumer_max_reconsume_times: 16
user_outbox:
enabled: true
topic: "hyapp_user_outbox"
consumer_group: "hyapp-room-user-region-sync"
consumer_max_reconsume_times: 16
outbox_worker:
# mq 模式下 outbox worker 只把事实投 MQ并顺带安排火箭延迟发射唤醒。
enabled: true
publish_mode: "mq"
poll_interval: "200ms"
batch_size: 50
concurrency: 16
publish_timeout: "15s"
retry_strategy: "exponential_backoff"
max_retry_count: 10
initial_backoff: "5s"
max_backoff: "5m"
# retention 按 updated_at_ms 小批量删除 delivered 历史事件,防止 room_outbox 无限增长。
# ⚠️ 开启前必须和数据侧确认 max_age 覆盖 replay-stat-tz/databi-real-flow-audit 等
# 直读 room_outbox 的重放与补数窗口或先归档再开启max_age 低于 24h 会拒绝启动。
retention:
enabled: false
max_age: "720h"
scan_interval: "5m"
batch_size: 500