server: port: 8082 spring: application: name: CollisionAvoidance # PostgreSQL数据源配置 - HikariCP连接池 datasource: url: jdbc:postgresql://localhost:5432/collision_avoidance username: postgres password: 123456 driver-class-name: org.postgresql.Driver # HikariCP连接池配置 hikari: # 连接池基础配置 maximum-pool-size: 20 # 最大连接数,适合PostGIS空间查询 minimum-idle: 5 # 最小空闲连接数 idle-timeout: 300000 # 空闲连接超时时间(5分钟) max-lifetime: 1200000 # 连接最大生命周期(20分钟) connection-timeout: 30000 # 获取连接超时时间(30秒) # PostGIS空间查询优化 leak-detection-threshold: 60000 # 连接泄漏检测阈值(1分钟) pool-name: "PostGIS-HikariPool" # 连接池名称 # 数据库连接优化 data-source-properties: # PostgreSQL性能优化参数 cachePrepStmts: true # 启用预编译语句缓存 prepStmtCacheSize: 250 # 预编译语句缓存大小 prepStmtCacheSqlLimit: 2048 # 缓存SQL长度限制 useServerPrepStmts: true # 使用服务器端预编译语句 # PostGIS空间数据优化 reWriteBatchedInserts: true # 重写批量插入SQL logUnclosedConnections: true # 记录未关闭的连接 connectTimeout: 10 # TCP连接超时(秒) socketTimeout: 60 # Socket读取超时(秒) # 应用程序标识 ApplicationName: "CollisionAvoidanceSystem" # Kafka配置 kafka: bootstrap-servers: 192.168.42.128:9092 producer: key-serializer: org.apache.kafka.common.serialization.StringSerializer value-serializer: org.springframework.kafka.support.serializer.JsonSerializer acks: 1 retries: 3 # 消费者配置(如果需要订阅其他服务的消息) consumer: group-id: data-collector-group auto-offset-reset: latest key-deserializer: org.apache.kafka.common.serialization.StringDeserializer value-deserializer: org.springframework.kafka.support.serializer.JsonDeserializer properties: spring.json.trusted.packages: "com.airport.common.model" # Redis配置 redis: host: localhost port: 6379 database: 0 timeout: 10000 lettuce: pool: max-active: 8 max-wait: -1 max-idle: 8 min-idle: 0 key-serialization: org.springframework.data.redis.serialization.StringRedisSerializer value-serialization: org.springframework.data.redis.serialization.Jackson2JsonRedisSerializer main: allow-bean-definition-overriding: true # JPA/Hibernate配置优化 jpa: hibernate: ddl-auto: update show-sql: false # 生产环境建议关闭 properties: hibernate: dialect: org.hibernate.spatial.dialect.postgis.PostgisPG95Dialect format_sql: false # 生产环境建议关闭 # PostGIS空间数据处理优化 jdbc: lob: non_contextual_creation: true batch_size: 50 # 批量操作大小 fetch_size: 50 # 查询获取大小 # 缓存配置 cache: use_second_level_cache: true # 启用二级缓存 use_query_cache: true # 启用查询缓存 region: factory_class: org.hibernate.cache.jcache.JCacheRegionFactory # 性能优化 order_inserts: true # 排序插入语句 order_updates: true # 排序更新语句 batch_versioned_data: true # 批量版本化数据处理 # 空间数据特定优化 spatial: connection_finder: org.hibernate.spatial.dialect.postgis.PostgisConnectionFinder # 性能监控和统计 generate_statistics: true # 启用Hibernate统计 log_slow_query: true # 记录慢查询 # 连接管理优化 connection: provider_disables_autocommit: true # 优化连接池性能 autocommit: false # 手动控制事务提交 # 数据采集配置 data: collector: interval: 10000 topics: position: aircraft-positions vehicle: vehicle-positions # 机场数据源配置 airport-api: base-url: http://localhost:8090 endpoints: login: /login aircraft: /openApi/getCurrentFlightPositions vehicle: /openApi/getCurrentVehiclePositions refresh: /refresh auth: username: dianxin password: dianxin@123 # 无人车厂商数据源配置 vehicle-api: base-url: http://127.0.0.1:31140 endpoints: vehicle-location: /api/VehicleLocationInfo vehicle-state: /api/VehicleStateInfo vehicle-command: /api/VehicleCommandInfo retention: redis-expire-seconds: 60 postgresql-days: 30 # 坐标系统配置 coordinate-system: airport: # 机场中心点坐标(默认:青岛胶东国际机场中心点) center-longitude: 120.0834104 center-latitude: 36.35406879 # 数据保留策略配置 # 性能监控和管理配置 management: endpoints: web: exposure: include: "*" endpoint: health: show-details: always # 数据库连接池监控 metrics: export: simple: enabled: true enable: hikari: true jvm: true # JMX监控 jmx: exposure: include: "*" logging: level: org: springframework: web: client: RestTemplate: DEBUG http: converter: json: TRACE # 数据库和连接池日志配置 com: zaxxer: hikari: DEBUG # HikariCP连接池日志 org: hibernate: SQL: DEBUG # SQL语句日志 type: descriptor: sql: BasicBinder: TRACE # SQL参数绑定日志 stat: DEBUG # Hibernate统计日志 engine: transaction: DEBUG # 事务日志 spatial: DEBUG # PostGIS空间查询日志 # PostGIS特定日志 net: postgis: DEBUG # PostGIS JDBC日志 # JPA查询性能日志 org.springframework.orm.jpa: DEBUG # 日志输出格式优化 pattern: console: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level [%logger{36}] - %msg%n" file: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level [%logger{36}] - %msg%n"