[공부] 프로그래밍
-
[error] required a single bean, but 3 were found[공부] 프로그래밍/ERROR 2024. 5. 14. 15:05
required a single bean, but 3 were found1. @Primary 사용여러 빈 중 하나를 기본 빈으로 설정하여, 우선순위를 정하도록 합니다.@Bean@Primarypublic Step sendNotificationStep() { // Step 빈 생성 로직}2. @Qualifier 사용메서드 파라미터에 특정 빈을 명시적으로 주입하도록 설정합니다.@Beanpublic Job sendNotificationBeforeClassJob(JobBuilderFactory jobBuilderFactory, StepBuilderFactory stepBuilderFactory, ..
-
Spring Batch 구현 - 7[공부] 프로그래밍/Spring・Spring Boot (JAVA) 2024. 5. 14. 12:46
♧ 전체 코드 : https://github.com/woodisco/pass-batch GitHub - woodisco/pass-batchContribute to woodisco/pass-batch development by creating an account on GitHub.github.com REST API로 Job 실행시키기① JobLauncherRequest 작성@Getter@Setter@ToStringpublic class JobLauncherRequest { private String name; private Properties jobParameters; public JobParameters getJobParameters() { return new JobParam..
-
Spring Batch 구현 - 6[공부] 프로그래밍/Spring・Spring Boot (JAVA) 2024. 5. 9. 11:25
♧ 전체 코드 : https://github.com/woodisco/pass-batch GitHub - woodisco/pass-batchContribute to woodisco/pass-batch development by creating an account on GitHub.github.com 통계 데이터 생성 배치① StatisticsRepository 작성② StatisticsEntity, AggregatedStatistics 작성③ CustomCSVWriter 작성④ MakeDailyStatisticsTasklet 작성⑤ MakeWeeklyStatisticsTasklet 작성⑥ MakeStatisticsJobConfig 작성@Slf4j@Configurationpublic class MakeSta..
-
Spring Batch 구현 - 5[공부] 프로그래밍/Spring・Spring Boot (JAVA) 2024. 5. 8. 11:11
♧ 전체 코드 : https://github.com/woodisco/pass-batch GitHub - woodisco/pass-batchContribute to woodisco/pass-batch development by creating an account on GitHub.github.com 수업 종료후, 이용권 차감 배치① UsePassesJobConfig 작성@Configurationpublic class UsePassesJobConfig { private final int CHUNK_SIZE = 5; private final EntityManagerFactory entityManagerFactory; private final PassRepository passRepository..
-
Spring Batch 구현 - 4[공부] 프로그래밍/Spring・Spring Boot (JAVA) 2024. 4. 25. 15:03
♧ 전체 코드 : https://github.com/woodisco/pass-batch GitHub - woodisco/pass-batchContribute to woodisco/pass-batch development by creating an account on GitHub.github.com 수업 전 알람 배치① SendNotificationBeforeClassJobConfig 작성@Beanpublic Step sendNotificationStep(JobRepository jobRepository, PlatformTransactionManager transactionManager,) { return new StepBuilder("send..