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 只投 MQ，activity/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"
