This commit is contained in:
mindol1004
2024-10-21 17:59:04 +09:00
parent d5e8941d5d
commit 868bb01453
57 changed files with 1913 additions and 99 deletions

View File

@@ -36,10 +36,32 @@ import lombok.extern.slf4j.Slf4j;
@RequiredArgsConstructor
public class QuartzJobLauncher extends QuartzJobBean {
/**
* JobParameters의 인스턴스 키입니다.
*
* <p>Job 실행 시 사용되는 인스턴스 ID를 저장합니다.</p>
*/
private static final String JOB_PARAMETERS_INSTANCE_KEY = "InstanceId";
/**
* JobParameters의 타임스탬프 키입니다.
*
* <p>Job 실행 시 현재 시간을 저장합니다.</p>
*/
private static final String JOB_PARAMETERS_TIMESTAMP_KEY = "timestamp";
/**
* JobLauncher 객체입니다.
*
* <p>Spring Batch Job을 실행하는 데 사용됩니다.</p>
*/
private final JobLauncher jobLauncher;
/**
* JobRegistry 객체입니다.
*
* <p>Spring Batch에서 등록된 Job을 조회하는 데 사용됩니다.</p>
*/
private final JobRegistry jobRegistry;
/**
@@ -53,6 +75,7 @@ public class QuartzJobLauncher extends QuartzJobBean {
* </ol>
*
* @param context Quartz JobExecutionContext 객체
* @throws JobExecutionException Job 실행 중 발생할 수 있는 예외
*/
@Override
protected void executeInternal(@NonNull JobExecutionContext context) throws JobExecutionException {
@@ -68,7 +91,7 @@ public class QuartzJobLauncher extends QuartzJobBean {
jobLauncher.run(job, params);
} catch (Exception e) {
log.error("Job execution exception! - {}", e.getMessage(), e);
throw new JobExecutionException();
throw new JobExecutionException(e);
}
}