# 조회 전용 서버 설정 (10.29.17.90)
# 배치 작업 없이 API 조회만 수행하는 프로파일
server:
  port: 8090
  tomcat:
    threads:
      max: 200
      min-spare: 10
    connection-timeout: 60000
    max-http-form-post-size: 50MB
    max-swallow-size: 50MB
    max-connections: 10000
    accept-count: 100

spring:
  datasource:
    # 조회 전용 DB (10.29.17.90 로컬 DB) - 표준 Spring Boot DataSource 설정
    url: jdbc:postgresql://localhost:5432/mpcdb2?currentSchema=signal&options=-csearch_path=signal,public&assumeMinServerVersion=12&reWriteBatchedInserts=true
    username: mpc
    password: mpc#8932
    driver-class-name: org.postgresql.Driver
    hikari:
      pool-name: QueryOnlyHikariPool
      connection-timeout: 5000
      idle-timeout: 600000
      max-lifetime: 1800000
      maximum-pool-size: 60
      minimum-idle: 10
      connection-test-query: SELECT 1
      validation-timeout: 5000
      leak-detection-threshold: 60000
      connection-init-sql: "SET TIME ZONE 'Asia/Seoul'; SET search_path TO signal, public;"
      data-source-properties:
        prepareThreshold: 3
        preparedStatementCacheQueries: 250

  # Request 크기 설정
  servlet:
    multipart:
      max-file-size: 50MB
      max-request-size: 50MB

  # Spring Batch 자동 구성 완전 비활성화
  autoconfigure:
    exclude:
      - org.springframework.boot.autoconfigure.batch.BatchAutoConfiguration

  # Spring Batch Job 비활성화
  batch:
    job:
      enabled: false
    jdbc:
      initialize-schema: never

logging:
  level:
    root: INFO
    gc.mda.signal_batch: DEBUG
    gc.mda.signal_batch.global.util: INFO
    gc.mda.signal_batch.global.websocket.service: INFO
    gc.mda.signal_batch.batch: WARN  # 배치 관련 로그 최소화
    gc.mda.signal_batch.domain: INFO
    gc.mda.signal_batch.monitoring: DEBUG
    gc.mda.signal_batch.monitoring.controller: INFO
    org.springframework.batch: WARN  # 배치 관련 로그 최소화
    org.springframework.jdbc: WARN
    org.postgresql: WARN
    com.zaxxer.hikari: INFO

# 배치 설정 (조회 전용 서버에서는 사용 안 함)
vessel:
  # 통합선박 기능 비활성화 (query DB에 통합테이블이 없을 수 있음)
  integration:
    enabled: false

  batch:
    # 스케줄러 비활성화 (중요!)
    scheduler:
      enabled: false
      incremental:
        delay-minutes: 3

    # 비정상 궤적 검출 비활성화
    abnormal-detection:
      enabled: false

    # 기타 배치 설정은 사용되지 않지만 기본값 유지
    chunk-size: 10000
    page-size: 5000
    partition-size: 12

# 액추에이터 설정
management:
  endpoints:
    web:
      exposure:
        include: health,info,metrics,prometheus,env,loggers,threaddump,heapdump
  endpoint:
    health:
      show-details: always
      show-components: always
  metrics:
    tags:
      application: vessel-query-server
      environment: query
