- source-schema.tables.ship-001 (tb_ship_default_info) 제거 - target-schema.tables.ship-002 (tb_ship_main_info) 제거 - target ship-001 → ship-002로 키 변경 (source와 매핑 일치) - source risk-compliance 키 변경: 002→003, 003→006 (target과 매핑 일치) - ShipDataWriter: saveShipMainInfo 호출 제거 - ShipRepository/Impl: saveShipMainInfo, bindShipMainInfo 제거 - ShipDataSql: getShipMainInfoUpsertSql 제거 - SyncStatusService: source-target 양쪽 매핑된 테이블만 조회 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
222 lines
7.5 KiB
YAML
222 lines
7.5 KiB
YAML
spring:
|
|
application:
|
|
name: snp-sync-batch
|
|
|
|
# 정의한 DataSource만 사용하도록 합니다. (필수)
|
|
autoconfigure:
|
|
exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
|
|
|
|
# ===============================================
|
|
# 1. 배치 메타데이터 데이터소스 (Primary)
|
|
# Spring Batch의 JobRepository가 사용하는 DB입니다.
|
|
# ===============================================
|
|
batch-meta-datasource:
|
|
jdbc-url: jdbc:postgresql://211.208.115.83:5432/snpdb?currentSchema=snp_batch
|
|
username: snp
|
|
password: snp#8932
|
|
driver-class-name: org.postgresql.Driver
|
|
# HikariCP 풀 설정 (선택적)
|
|
hikari:
|
|
maximum-pool-size: 10
|
|
minimum-idle: 5
|
|
connection-timeout: 30000
|
|
|
|
# ===============================================
|
|
# 2. 비즈니스 데이터 데이터소스
|
|
# Spring Batch Step(ItemReader/Writer)이 데이터를 읽고 쓰는 DB입니다.
|
|
# ===============================================
|
|
business-datasource:
|
|
jdbc-url: jdbc:postgresql://211.208.115.83:5432/snpdb?currentSchema=std_snp_data
|
|
username: snp
|
|
password: snp#8932
|
|
driver-class-name: org.postgresql.Driver
|
|
# HikariCP 풀 설정 (선택적)
|
|
hikari:
|
|
maximum-pool-size: 10
|
|
minimum-idle: 5
|
|
connection-timeout: 30000
|
|
|
|
# JPA Configuration
|
|
jpa:
|
|
hibernate:
|
|
ddl-auto: update
|
|
show-sql: false
|
|
properties:
|
|
hibernate:
|
|
dialect: org.hibernate.dialect.PostgreSQLDialect
|
|
format_sql: true
|
|
default_schema: snp_batch
|
|
|
|
# Batch Configuration
|
|
batch:
|
|
jdbc:
|
|
table-prefix: "snp_batch.batch_"
|
|
initialize-schema: always # Changed to 'never' as tables already exist
|
|
job:
|
|
enabled: false # Prevent auto-run on startup
|
|
|
|
# Quartz Scheduler Configuration - Using JDBC Store for persistence
|
|
quartz:
|
|
job-store-type: jdbc # JDBC store for schedule persistence
|
|
jdbc:
|
|
initialize-schema: always # Create Quartz tables if not exist
|
|
properties:
|
|
org.quartz.scheduler.instanceName: SNPBatchScheduler
|
|
org.quartz.scheduler.instanceId: AUTO
|
|
org.quartz.threadPool.threadCount: 10
|
|
org.quartz.jobStore.class: org.quartz.impl.jdbcjobstore.JobStoreTX
|
|
org.quartz.jobStore.driverDelegateClass: org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
|
|
org.quartz.jobStore.tablePrefix: QRTZ_
|
|
org.quartz.jobStore.isClustered: false
|
|
org.quartz.jobStore.misfireThreshold: 60000
|
|
|
|
# Server Configuration
|
|
server:
|
|
port: 8051
|
|
servlet:
|
|
context-path: /snp-sync
|
|
|
|
# Actuator Configuration
|
|
management:
|
|
endpoints:
|
|
web:
|
|
exposure:
|
|
include: health,info,metrics,prometheus,batch
|
|
endpoint:
|
|
health:
|
|
show-details: always
|
|
|
|
# Logging Configuration
|
|
logging:
|
|
level:
|
|
root: INFO
|
|
com.snp.batch: DEBUG
|
|
org.springframework.batch: WARN
|
|
org.springframework.jdbc: WARN
|
|
pattern:
|
|
console: "%d{yyyy-MM-dd HH:mm:ss} - %msg%n"
|
|
file: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
|
file:
|
|
name: logs/snp-sync-batch.log
|
|
|
|
# Custom Application Properties
|
|
app:
|
|
batch:
|
|
chunk-size: 10000
|
|
sub-chunk-size: 5000 # Writer Sub-Chunk 분할 크기
|
|
source-schema:
|
|
name: std_snp_data
|
|
tables:
|
|
ship-002: tb_ship_info_mst
|
|
ship-003: tb_ship_add_info
|
|
ship-004: tb_ship_bbctr_hstry
|
|
ship-005: tb_ship_idntf_info_hstry
|
|
ship-006: tb_ship_clfic_hstry
|
|
ship-007: tb_ship_company_rel
|
|
ship-008: tb_ship_crew_list
|
|
ship-009: tb_ship_dark_actv_idnty
|
|
ship-010: tb_ship_country_hstry
|
|
ship-011: tb_ship_group_revn_ownr_hstry
|
|
ship-012: tb_ship_ice_grd
|
|
ship-013: tb_ship_nm_chg_hstry
|
|
ship-014: tb_ship_operator_hstry
|
|
ship-015: tb_ship_ownr_hstry
|
|
ship-016: tb_ship_prtc_rpn_hstry
|
|
ship-017: tb_ship_sfty_mng_evdc_hstry
|
|
ship-018: tb_ship_mng_company_hstry
|
|
ship-019: tb_ship_sstrvsl_rel
|
|
ship-020: tb_ship_spc_fetr
|
|
ship-021: tb_ship_status_hstry
|
|
ship-022: tb_ship_cargo_capacity
|
|
ship-023: tb_ship_inspection_ymd
|
|
ship-024: tb_ship_inspection_ymd_hstry
|
|
ship-025: tb_ship_tech_mng_company_hstry
|
|
ship-026: tb_ship_thrstr_info
|
|
company-001: tb_company_dtl_info
|
|
event-001: tb_event_mst
|
|
event-002: tb_event_cargo
|
|
event-003: tb_event_humn_acdnt
|
|
event-004: tb_event_rel
|
|
facility-001: tb_port_facility_info
|
|
psc-001: tb_psc_mst
|
|
psc-002: tb_psc_defect
|
|
psc-003: tb_psc_oa_certf
|
|
movements-001: tb_ship_anchrgcall_hstry
|
|
movements-002: tb_ship_berthcall_hstry
|
|
movements-003: tb_ship_now_status_hstry
|
|
movements-004: tb_ship_dest_hstry
|
|
movements-005: tb_ship_prtcll_hstry
|
|
movements-006: tb_ship_sts_opert_hstry
|
|
movements-007: tb_ship_teminalcall_hstry
|
|
movements-008: tb_ship_trnst_hstry
|
|
code-001: tb_ship_type_cd
|
|
code-002: tb_ship_country_cd
|
|
risk-compliance-001: tb_ship_risk_info
|
|
risk-compliance-003: tb_ship_compliance_info
|
|
risk-compliance-006: tb_company_compliance_info
|
|
target-schema:
|
|
name: std_snp_svc
|
|
tables:
|
|
ship-002: tb_ship_info_mst
|
|
ship-003: tb_ship_add_info
|
|
ship-004: tb_ship_bbctr_hstry
|
|
ship-005: tb_ship_idntf_info_hstry
|
|
ship-006: tb_ship_clfic_hstry
|
|
ship-007: tb_ship_company_rel
|
|
ship-008: tb_ship_crew_list
|
|
ship-009: tb_ship_dark_actv_idnty
|
|
ship-010: tb_ship_country_hstry
|
|
ship-011: tb_ship_group_revn_ownr_hstry
|
|
ship-012: tb_ship_ice_grd
|
|
ship-013: tb_ship_nm_chg_hstry
|
|
ship-014: tb_ship_operator_hstry
|
|
ship-015: tb_ship_ownr_hstry
|
|
ship-016: tb_ship_prtc_rpn_hstry
|
|
ship-017: tb_ship_sfty_mng_evdc_hstry
|
|
ship-018: tb_ship_mng_company_hstry
|
|
ship-019: tb_ship_sstrvsl_rel
|
|
ship-020: tb_ship_spc_fetr
|
|
ship-021: tb_ship_status_hstry
|
|
ship-022: tb_ship_cargo_capacity
|
|
ship-023: tb_ship_inspection_ymd
|
|
ship-024: tb_ship_inspection_ymd_hstry
|
|
ship-025: tb_ship_tech_mng_company_hstry
|
|
ship-026: tb_ship_thrstr_info
|
|
company-001: tb_company_dtl_info
|
|
event-001: tb_event_mst
|
|
event-002: tb_event_cargo
|
|
event-003: tb_event_humn_acdnt
|
|
event-004: tb_event_rel
|
|
facility-001: tb_port_facility_info
|
|
psc-001: tb_psc_mst
|
|
psc-002: tb_psc_defect
|
|
psc-003: tb_psc_oa_certf
|
|
movements-001: tb_ship_anchrgcall_hstry
|
|
movements-002: tb_ship_berthcall_hstry
|
|
movements-003: tb_ship_now_status_hstry
|
|
movements-004: tb_ship_dest_hstry
|
|
movements-005: tb_ship_prtcll_hstry
|
|
movements-006: tb_ship_sts_opert_hstry
|
|
movements-007: tb_ship_teminalcall_hstry
|
|
movements-008: tb_ship_trnst_hstry
|
|
code-001: tb_ship_type_cd
|
|
code-002: tb_ship_country_cd
|
|
risk-compliance-001: tb_ship_risk_info
|
|
risk-compliance-002: tb_ship_risk_hstry
|
|
risk-compliance-003: tb_ship_compliance_info
|
|
risk-compliance-004: tb_ship_compliance_hstry
|
|
risk-compliance-005: tb_ship_compliance_info_hstry
|
|
risk-compliance-006: tb_company_compliance_info
|
|
risk-compliance-007: tb_company_compliance_hstry
|
|
risk-compliance-008: tb_company_compliance_info_hstry
|
|
api:
|
|
url: https://api.example.com/data
|
|
timeout: 30000
|
|
ship-api:
|
|
url: https://shipsapi.maritime.spglobal.com
|
|
username: 7cc0517d-5ed6-452e-a06f-5bbfd6ab6ade
|
|
password: 2LLzSJNqtxWVD8zC
|
|
schedule:
|
|
enabled: true
|
|
cron: "0 0 * * * ?" # Every hour
|