server:
  port: 6027

spring:
  datasource:
    dynamic:
      primary: kucoin             # 默认数据源
      strict: false
      datasource:
        kucoin:
          driver-class-name: com.mysql.cj.jdbc.Driver
          url: jdbc:mysql://172.31.39.212:3306/kucoin?characterEncoding=utf-8&serverTimezone=GMT%2B8&useSSL=false
          username: kucoin
          password: KCrbYZ2XcjBtxzdG
        market:
          driver-class-name: com.mysql.cj.jdbc.Driver
          url: jdbc:mysql://172.31.39.212:3306/market?characterEncoding=utf-8&serverTimezone=GMT%2B8&useSSL=false&allowMultiQueries=true
          username: market
          password: 35a8EMd3pxppsSMw

  kafka:
    bootstrap-servers: 172.31.39.212:9092
    producer:
      key-serializer: org.apache.kafka.common.serialization.StringSerializer
      value-serializer: org.apache.kafka.common.serialization.StringSerializer
      retries: 0
      batch-size: 16384
      buffer-memory: 33554432
    consumer:
      key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
      value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
      enable-auto-commit: false
      auto-offset-reset: earliest
      properties:
        session.timeout.ms: 15000
    listener:
      ack-mode: manual_immediate

  redis:
    host: 172.31.39.212
    port: 6379
    password: redis123!
    database: 0
    timeout: 5000ms
    lettuce:
      pool:
        max-active: 8
        max-idle: 8
        min-idle: 1
        max-wait: 2000

mybatis-plus:
  mapper-locations: classpath*:mapper/**/*.xml

market:
  # SOCKS5 代理配置（国内服务器绕过 GFW 对 Binance 数据帧的过滤）
  # 不填或留空则直连
  proxy:
    host: ""
    port: 45001
    username: ""
    password: ""
  kafka:
    topic:
      # 手动注入合约价格（外部发布，market-service 消费）
      manual-price: FUTURES_MANUAL_PRICE
    consumer:
      group-id: market-group

# 现货模块配置
spot:
  binance:
    # Binance 现货 WebSocket combined stream 地址
    ws-url: wss://stream.binance.com:9443/stream
    # Binance 现货 REST API 地址（K线同步用）
    rest-url: https://api.binance.com
  kafka:
    topic:
      # 通知撮合模块最新成交价
      new-price: SPOT_NEW_PRICE
      manual-price: SPOT_MANUAL_PRICE
      # 行情机器人自动生成价格（robot 生产，market-service 消费处理推送）
      robot-price: SPOT_ROBOT_PRICE
      # 资产/订单变动消息（由撮合模块发布）
      asset-change: SPOT_CHANGE
    consumer:
      group-id: spot-market-group
      robot-group-id: spot-robot-group

logging:
  level:
    org.apache.tomcat.websocket: ERROR

