spring:
  application:
    name: vehicle-history-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

server:
  port: ${HTTP_PORT:20200}

springdoc:
  swagger-ui:
    path: /swagger-ui.html
  api-docs:
    path: /v3/api-docs

lingniu:
  ingest:
    gb32960:
      enabled: true
      server:
        enabled: false
    sink:
      kafka:
        enabled: true
        bootstrap-servers: ${KAFKA_BROKERS:114.55.58.251:9092}
        topics:
          realtime: ${KAFKA_TOPIC_GB32960_EVENT:vehicle.event.gb32960.v1}
          raw-archive: ${KAFKA_TOPIC_GB32960_RAW:vehicle.raw.gb32960.v1}
          dlq: ${KAFKA_TOPIC_GB32960_DLQ:vehicle.dlq.gb32960.v1}
        consumer:
          enabled: ${KAFKA_CONSUMER_ENABLED:true}
          client-id-prefix: ${KAFKA_CONSUMER_CLIENT_ID_PREFIX:vehicle-history}
          auto-offset-reset: ${KAFKA_CONSUMER_AUTO_OFFSET_RESET:earliest}
          max-poll-records: ${KAFKA_CONSUMER_MAX_POLL_RECORDS:2000}
          max-poll-interval-millis: ${KAFKA_CONSUMER_MAX_POLL_INTERVAL_MILLIS:1800000}
          concurrency: ${KAFKA_CONSUMER_CONCURRENCY:3}
          bindings:
            eventHistoryGb32960EnvelopeConsumerProcessor:
              enabled: true
              group-id: ${KAFKA_GROUP_HISTORY_GB32960_EVENT:${KAFKA_GROUP_HISTORY:vehicle-history}-gb32960-event}
              topics:
                - ${KAFKA_TOPIC_GB32960_EVENT:vehicle.event.gb32960.v1}
            eventHistoryJt808EnvelopeConsumerProcessor:
              enabled: true
              group-id: ${KAFKA_GROUP_HISTORY_JT808_EVENT:${KAFKA_GROUP_HISTORY:vehicle-history}-jt808-event}
              topics:
                - ${KAFKA_TOPIC_JT808_EVENT:vehicle.event.jt808.v1}
            eventHistoryYutongMqttEnvelopeConsumerProcessor:
              enabled: true
              group-id: ${KAFKA_GROUP_HISTORY_YUTONG_MQTT_EVENT:${KAFKA_GROUP_HISTORY:vehicle-history}-yutong-mqtt-event}
              topics:
                - ${KAFKA_TOPIC_YUTONG_MQTT_EVENT:vehicle.event.mqtt-yutong.v1}
            eventHistoryGb32960RawEnvelopeConsumerProcessor:
              enabled: true
              group-id: ${KAFKA_GROUP_HISTORY_GB32960_RAW:${KAFKA_GROUP_HISTORY:vehicle-history}-gb32960-raw}
              topics:
                - ${KAFKA_TOPIC_GB32960_RAW:vehicle.raw.gb32960.v1}
            eventHistoryJt808RawEnvelopeConsumerProcessor:
              enabled: true
              group-id: ${KAFKA_GROUP_HISTORY_JT808_RAW:${KAFKA_GROUP_HISTORY:vehicle-history}-jt808-raw}
              topics:
                - ${KAFKA_TOPIC_JT808_RAW:vehicle.raw.jt808.v1}
            eventHistoryYutongMqttRawEnvelopeConsumerProcessor:
              enabled: true
              group-id: ${KAFKA_GROUP_HISTORY_YUTONG_MQTT_RAW:${KAFKA_GROUP_HISTORY:vehicle-history}-yutong-mqtt-raw}
              topics:
                - ${KAFKA_TOPIC_YUTONG_MQTT_RAW:vehicle.raw.mqtt-yutong.v1}
    tdengine-history:
      enabled: ${TDENGINE_HISTORY_ENABLED:false}
      database: ${TDENGINE_HISTORY_DATABASE:vehicle_history}
      jdbc-url: ${TDENGINE_JDBC_URL:jdbc:TAOS-RS://${TDENGINE_HOST:127.0.0.1}:${TDENGINE_PORT:6041}/${TDENGINE_HISTORY_DATABASE:vehicle_history}}
      username: ${TDENGINE_USERNAME:root}
      password: ${TDENGINE_PASSWORD:taosdata}
      driver-class-name: ${TDENGINE_DRIVER_CLASS_NAME:com.taosdata.jdbc.rs.RestfulDriver}
      maximum-pool-size: ${TDENGINE_MAX_POOL_SIZE:16}
      minimum-idle: ${TDENGINE_MIN_IDLE:0}
      connection-timeout-millis: ${TDENGINE_CONNECTION_TIMEOUT_MILLIS:5000}
      initialization-fail-timeout-millis: ${TDENGINE_INITIALIZATION_FAIL_TIMEOUT_MILLIS:-1}
    event-history:
      enabled: true

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