spring:
  application:
    name: gb32960-ingest-app
  config:
    import:
      - optional:nacos:${spring.application.name}.${NACOS_CONFIG_FILE_EXTENSION:yml}?group=${NACOS_GROUP:DEFAULT_GROUP}&refreshEnabled=${NACOS_REFRESH_ENABLED:true}
  cloud:
    nacos:
      config:
        enabled: ${NACOS_CONFIG_ENABLED:true}
        server-addr: ${NACOS_SERVER_ADDR:127.0.0.1:8848}
        namespace: ${NACOS_NAMESPACE:}
        group: ${NACOS_GROUP:DEFAULT_GROUP}
        file-extension: ${NACOS_CONFIG_FILE_EXTENSION:yml}
        username: ${NACOS_USERNAME:}
        password: ${NACOS_PASSWORD:}
  threads:
    virtual:
      enabled: true
  data:
    redis:
      host: ${REDIS_HOST:127.0.0.1}
      port: ${REDIS_PORT:6379}
      username: ${REDIS_USERNAME:}
      password: ${REDIS_PASSWORD:}
      database: ${REDIS_DATABASE:50}

server:
  port: ${HTTP_PORT:20100}

lingniu:
  ingest:
    gb32960:
      enabled: true
      server:
        enabled: true
      port: ${GB32960_PORT:32960}
      boss-threads: ${GB32960_BOSS_THREADS:1}
      worker-threads: ${GB32960_WORKER_THREADS:0}
      auth:
        enabled: ${GB32960_AUTH_ENABLED:false}
        case-sensitive: false
        whitelist: []
        platforms:
          - username: ${GB32960_PLATFORM_USER_HYUNDAI:Hyundai}
            password: ${GB32960_PLATFORM_PWD_HYUNDAI:}
            allowed-ips:
              - ${GB32960_PLATFORM_IP_HYUNDAI:}
            description: 外部下级平台 - Hyundai
          - username: ${GB32960_PLATFORM_USER_YUEJIN:YueJin}
            password: ${GB32960_PLATFORM_PWD_YUEJIN:}
            allowed-ips:
              - ${GB32960_PLATFORM_IP_YUEJIN:}
            description: 外部下级平台 - YueJin
      tls:
        enabled: ${GB32960_TLS_ENABLED:false}
        cert-path: ${GB32960_TLS_CERT:}
        key-path: ${GB32960_TLS_KEY:}
        trust-cert-path: ${GB32960_TLS_CA:}
        require-client-auth: true
      vendor-extensions:
        - name: guangdong-fc
          match:
            platform-accounts:
              - Hyundai
              - YueJin
            vin-prefixes: []
            vins: []
      parse:
        lenient-block-failure: true
      diagnostics:
        max-logged-frame-keys-per-channel: ${GB32960_DIAGNOSTICS_MAX_LOGGED_FRAME_KEYS_PER_CHANNEL:4096}
    pipeline:
      disruptor:
        ring-buffer-size: ${PIPELINE_RING_BUFFER_SIZE:131072}
        wait-strategy: ${PIPELINE_WAIT_STRATEGY:yielding}
        producer-type: multi
      dedup:
        enabled: true
        cache-size: 200000
        ttl-seconds: 600
      rate-limit:
        per-vin-qps: 50
    session:
      store: redis
      ttl: ${SESSION_TTL:30m}
    identity:
      store: mysql
      mysql:
        jdbc-url: ${VEHICLE_IDENTITY_MYSQL_JDBC_URL:jdbc:mysql://127.0.0.1:3306/lingniu_vehicle?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai}
        username: ${VEHICLE_IDENTITY_MYSQL_USERNAME:root}
        password: ${VEHICLE_IDENTITY_MYSQL_PASSWORD:}
        table-name: ${VEHICLE_IDENTITY_MYSQL_TABLE:vehicle_identity_bindings}
        initialize-schema: ${VEHICLE_IDENTITY_MYSQL_INITIALIZE_SCHEMA:true}
    sink:
      kafka:
        enabled: true
        bootstrap-servers: ${KAFKA_BROKERS:114.55.58.251:9092}
        compression-type: zstd
        linger-ms: 20
        batch-size: 65536
        acks: all
        enable-idempotence: true
        node-id: ${KAFKA_NODE_ID:gb32960-ingest-local}
        topics:
          realtime: ${KAFKA_TOPIC_GB32960_EVENT:vehicle.event.gb32960.v1}
          location: ${KAFKA_TOPIC_GB32960_EVENT:vehicle.event.gb32960.v1}
          alarm: ${KAFKA_TOPIC_GB32960_EVENT:vehicle.event.gb32960.v1}
          session: ${KAFKA_TOPIC_GB32960_EVENT:vehicle.event.gb32960.v1}
          media-meta: ${KAFKA_TOPIC_MEDIA_META:vehicle.media.meta.v1}
          raw-archive: ${KAFKA_TOPIC_GB32960_RAW:vehicle.raw.gb32960.v1}
          dlq: ${KAFKA_TOPIC_GB32960_DLQ:vehicle.dlq.gb32960.v1}
        consumer:
          enabled: false
      archive:
        enabled: ${SINK_ARCHIVE_ENABLED:true}
        type: local
        path: ${SINK_ARCHIVE_PATH:./archive/}

management:
  endpoints:
    web:
      exposure:
        include: health,info,metrics,prometheus,gb32960sessions
  endpoint:
    health:
      probes:
        enabled: ${MANAGEMENT_HEALTH_PROBES_ENABLED:true}
  health:
    redis:
      enabled: ${MANAGEMENT_HEALTH_REDIS_ENABLED:false}
  metrics:
    tags:
      application: gb32960-ingest-app

logging:
  level:
    root: INFO
    com.lingniu.ingest: INFO
