//Google AdSense

IAM user 관련 resource들은 data source로 사용하고 있었다.

오늘 아침 평소와 같이 plan을 명령했다가 갑작스럽게 404 error를 마주하게 된 것이다..

Error: error getting user: NoSuchEntity: The user with name * cannot be found.
│       status code: 404, request id: *-*-*-*-*
│
│   with module.iam.data.aws_iam_user.*,
│   on modules/IAM/users.tf line 33, in data "aws_iam_user" "*":
│   33: data "aws_iam_user" "*" {

근데 아주 별 일이 아니었다. 아주아주..
해당 user 분께서 퇴사하시면서 IAM 유저를 삭제하고 가셨기 때문에 참조 할 data가 없었을 뿐이다..! 허허

'DevOps' 카테고리의 다른 글

[Terraform] AWS Infra terraforming 하기  (0) 2021.08.26

기존에 구축된 AWS Infra를 Terraform을 이용해서 IaC화 하고있는 중인데
기능별로 modularization을 했더니 resource를 참조할 때 난리가 난리가 난리가 아니다!!

초반에는 존재하는 resource를 terraform으로 import하기가 까다로워서 한참 삽질을 했는데
한다리 건너고 나니 또 즐거운 issue 발생~~ 
좀 더 구조적인 modularization 방법을 고민해야할 것 같다!

그리고 terraform은 global variable이 없는 것 같다..
module을 이용해서 꼼수를 부려보았지만
map이나 list를 읽어오면 element들이 확실하게 표현되지 않아서 마음이 쓰인다...
난 확실한게 좋다구~

terraform community나 다른 분들의 해결책을 참고해봐야겠다!
다른 방법이 분명 있을거야..!

 

 

 

스프링 배치 완벽 가이드 2/e

2019년에 원서 definitive guide to soring batch가 나왔고 21년 4월 30일에 번역본이 나왔으니까 엄청 따끈따끈한 책이다.

국내에는 spring batch 자료도 많이 없고 초보개발자로서 헤딩하며 공부하다보니 검색해서 비슷한 말만 읽는 것 보다 스프링 배치 개발팀의 리더가 직접 저술했고 일목요연하게 정리된 책으로 읽어보는게 더 도움이 될 것 같다. 실습 예제도 있으니까 도움이 많이 되지 않을까? 

'Diary' 카테고리의 다른 글

JUnit / TDD  (0) 2020.07.13
형상관리 ( SVN , GIT)  (0) 2020.07.08
user block limit reached 오류  (0) 2020.07.01
호스팅 받은 웹에 프로젝트 배포했을 때 db 연결이 안되는 오류..  (0) 2020.06.26

마켓비를 홍보하는건 아니구 마침 그 페이지가 켜져있었지 뭐야..


package crawling.practice.app;

import java.io.IOException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public class JsoupPractice01 {
	public static void main(String[] args) throws IOException {
		String url = "https://marketb.kr/" ;
		
		Document doc = Jsoup.connect(url).get();
		
		Elements ele = doc.select(".column4");
		
		for(Element e : ele.select("li.item")) {
			System.out.println(e.text()+"\n");
		}	
	}
}
[ONLY] 마켓비 ESTO, DALIA, ELROY 태양광무드등 당일발송 판매가 :6,900원 소비자가 :9,800원 : 리뷰 :

[ONLY] 마켓비 DUGLAS 선반 시리즈 아카시아 당일발송 판매가 :22,900원 소비자가 :45,900원 : 리뷰 :

마켓비 SAZA 러그 D100 당일발송 판매가 :39,900원 : 리뷰 :

마켓비 OFFICY 서랍장 4.1단 당일발송 판매가 :38,900원 : 리뷰 :

마켓비 POLABO 미니수납장 넓은 2문 SHM4262SL 당일발송 판매가 :44,900원 소비자가 :89,900원 : 리뷰 :

마켓비 VAINZ 단스탠드 E14 KS2404T 브라운 당일발송 판매가 :29,900원 소비자가 :49,900원 : 리뷰 :

마켓비 SHOLID 책꽂이 7045 SHM4570 캄포어베니어 당일발송 판매가 :69,900원 : 리뷰 :

마켓비 NISKO 3인 멀티 메모리폼 소파베드 독립형 BC267 당일발송 판매가 :399,000원 소비자가 :789,000원 : 리뷰 :

마켓비 SIMPLIE 시리즈 당일발송 판매가 :129,300원 소비자가 :258,600원 : 리뷰 :

마켓비 FILMON 미니수납장 4문 4242 NFM4242 당일발송 판매가 :41,900원 소비자가 :83,800원 : 리뷰 :

[ONLY] 마켓비 JAWAL 2단 선반행거 대나무 0005.1882 당일발송 판매가 :28,900원 소비자가 :29,900원 : 리뷰 :

마켓비 AMBO 4인 멀티 소파베드 당일발송 판매가 :289,000원 소비자가 :499,000원 : 리뷰 :

마켓비 SHENBON 의자 라탄 D형 5672.2846 당일발송 판매가 :149,000원 : 리뷰 :

마켓비 MONTAC 5문 수납장 13376 CHM76133 캄포어베니어 당일발송 판매가 :199,000원 : 리뷰 :

마켓비 INSIA 목쿠션 ISC0042 레인보우 당일발송 판매가 :19,900원 : 리뷰 :

마켓비 PASAR 3인소파 라탄 CR0053 당일발송 판매가 :699,000원 소비자가 :899,000원 : 리뷰 :

마켓비 DELU 소파 1665 시리즈 당일발송 판매가 :269,000원 : 리뷰 :

[ONLY] 마켓비 FILSTEM 장바구니 시리즈 당일발송 판매가 :900원 소비자가 :7,200원 : 리뷰 :

마켓비 GIBORN USB LED 바조명 시리즈 당일발송 판매가 :11,000원 : 리뷰 :

[캔들/할로겐전구 무료증정] 마켓비 NEW SAMONY 미니 캔들워머 GU10 버튼 KS2306T 당일발송 판매가 :29,900원 : 리뷰 :

마켓비 SHOLID 서랍 2단 DRM4235D2 캄포어베니어 당일발송 판매가 :55,900원 : 리뷰 :

마켓비 TANG 원목의자 45 아카시아 당일발송 판매가 :49,900원 : 리뷰 :

마켓비 DACONA 소파 시리즈 당일발송 판매가 :259,000원 소비자가 :499,000원 : 리뷰 :

마켓비 MONER 장스탠드 E26 KS2333F 화이트 6411.4045 당일발송 판매가 :59,900원 소비자가 :69,900원 : 리뷰 :

마켓비 FILMON 선반수납장 10860 PUM60110OP 캄포어베니어 당일발송 판매가 :159,000원 소비자가 :318,000원 : 리뷰 :

마켓비 FILMON 협탁 3865 STBM6538 캄포어베니어 당일발송 판매가 :83,000원 소비자가 :166,000원 : 리뷰 :

마켓비 NISKO 소파/소파베드 시리즈 당일발송 판매가 :329,000원 소비자가 :719,000원 : 리뷰 :

마켓비 FILMON 4인 원목접이식테이블 세트 DCM74120 7월 중순 입고예정 판매가 :299,000원 소비자가 :598,000원 : 리뷰 :

마켓비 ALOTA 선반 380 3단 라탄 세트 WP3008 당일발송 판매가 :69,900원 소비자가 :139,000원 : 리뷰 :

[ONLY] 마켓비 KUBAN 소파 시리즈 당일발송 판매가 :219,000원 소비자가 :449,000원 : 리뷰 :

마켓비 PECRE 빈티지수납장 PC0102DR 6319.0243 당일발송 판매가 :299,000원 : 리뷰 :

마켓비 DUBLIN 이동식행거 9001650 당일발송 판매가 :33,900원 : 리뷰 :

[ONLY] 마켓비 ROONA 시리즈 당일발송 판매가 :89,900원 소비자가 :449,000원 : 리뷰 :

[ONLY] 마켓비 JAWAL 2단 선반행거 대나무 0005.1882 당일발송 판매가 :28,900원 소비자가 :29,900원 : 리뷰 :

[ONLY] 마켓비 BREDO 의자 당일발송 판매가 :69,900원 소비자가 :89,900원 : 리뷰 :

마켓비 SHENBON 의자 라탄 A형 당일발송 판매가 :139,000원 : 리뷰 :

마켓비 PECRE 빈티지소파 PC0048SF/PC0049SF 당일발송 판매가 :629,900원 : 리뷰 :

마켓비 회전의자 시리즈 당일발송 판매가 :53,900원 : 리뷰 :

[ONLY] 마켓비 PASAR 커피테이블 80 라탄 CR0039 브라운 당일발송 판매가 :199,000원 소비자가 :299,000원 : 리뷰 :

마켓비 MILTON 푸프 당일발송 판매가 :69,900원 : 리뷰 :

[ONLY] 마켓비 NEW HAVEN 2문 수납장 G3915 슬레이트그레이 당일발송 판매가 :499,000원 소비자가 :599,000원 : 리뷰 :

[ONLY] 마켓비 GLABO 커피테이블 6040 대나무 당일발송 판매가 :39,900원 소비자가 :49,900원 : 리뷰 :

[ONLY] 마켓비 MOBOOK 사이드테이블 5030 고무나무 당일발송 판매가 :69,900원 소비자가 :89,900원 : 리뷰 :

마켓비 PECRE 빈티지캐비넷 1문 PC0141CB 판매가 :189,000원 소비자가 :199,000원 : 리뷰 :

[ONLY] 마켓비 BAMBOU 단스탠드 E26 KS2200T 당일발송 판매가 :41,900원 소비자가 :49,900원 : 리뷰 :

[ONLY] 마켓비 TETOS 시리즈 당일발송 판매가 :34,900원 소비자가 :109,900원 : 리뷰 :

[ONLY] 마켓비 BAMBOU 단스탠드 E26 KS2201T 당일발송 판매가 :41,900원 소비자가 :49,900원 : 리뷰 :

[ONLY] 마켓비 GRUET 트롤리 시리즈 당일발송 판매가 :39,900원 소비자가 :55,900원 : 리뷰 :

[ONLY] 마켓비 CORKA 사이드테이블 2종세트 당일발송 판매가 :139,000원 소비자가 :169,000원 : 리뷰 :

마켓비 GLABO 사이드테이블 4040 대나무 당일발송 판매가 :24,900원 : 리뷰 :

마켓비 DUMBUL 스탠드행거 170 당일발송 판매가 :29,900원 : 리뷰 :

[ONLY] 마켓비 HIXA 단스탠드 E26 KS2186T 당일발송 판매가 :29,900원 소비자가 :39,900원 : 리뷰 :

[ONLY] 마켓비 APIN 사이드테이블 D45 티크나무 당일발송 판매가 :129,000원 소비자가 :139,000원 : 리뷰 :

[ONLY] 마켓비 PANTEG 원목벽걸이 소나무 당일발송 판매가 :26,900원 소비자가 :29,900원 : 리뷰 :

[ONLY] 마켓비 CAMFOL 접이식의자 시리즈 당일발송 판매가 :19,900원 소비자가 :29,900원 : 리뷰 :

[ONLY] 마켓비 MKB 커피테이블 서랍장 2칸 802402 당일발송 판매가 :80,000원 소비자가 :88,000원 : 리뷰 :

마켓비 BUGOK 소파 시리즈 당일발송 판매가 :189,000원 : 리뷰 :

마켓비 FRUGA 원목침대 퀸 150200 당일발송 판매가 :129,000원 : 리뷰 :

[ONLY] 마켓비 CHAMBER 벙커침대 싱글 100200 KS1006BD 당일발송 판매가 :159,000원 소비자가 :219,000원 : 리뷰 :

[ONLY] 마켓비 MILKAM 서랍장 3단 CHM7570 캄포어베니어 당일발송 판매가 :149,000원 소비자가 :189,000원 : 리뷰 :

[ONLY] 마켓비 FILMON 시리즈 당일발송 판매가 :39,900원 소비자가 :79,800원 : 리뷰 :

[ONLY] ASHLEY H309-10 LEWIS HOME OFFICE SMALL DESK 책상 당일발송 판매가 :169,000원 소비자가 :180,000원 : 리뷰 :

[ONLY] 마켓비 DUKUN 트롤리 3단 15040 당일발송 판매가 :189,000원 소비자가 :199,000원 : 리뷰 :

마켓비 TARDO 소파 시리즈 당일발송 판매가 :189,000원 소비자가 :219,000원 : 리뷰 :

[ONLY] 마켓비 BERGEN 데이베드 침대 싱글 100200 당일발송 판매가 :89,000원 소비자가 :99,000원 : 리뷰 :

마켓비 회전의자 시리즈 당일발송 판매가 :53,900원 : 리뷰 :

[ONLY] 마켓비 MILKAM 사이드콘솔 5865 CHM6558 당일발송 판매가 :89,000원 소비자가 :119,000원 : 리뷰 :

[ONLY] 마켓비 DEMIL 소파 시리즈 당일발송 판매가 :179,000원 소비자가 :309,000원 : 리뷰 :

[ONLY] 마켓비 WESTOVER 접이식의자 망고나무 당일발송 판매가 :69,000원 소비자가 :89,000원 : 리뷰 :

마켓비 KANIKA 마크라메 펜던트 등갓 시리즈 당일발송 판매가 :39,900원 : 리뷰 :

[ONLY] 마켓비 MIRANS 가로 2문 수납장 NFM9280G 당일발송 판매가 :169,000원 소비자가 :199,000원 : 리뷰 :

마켓비 KANIKA 장스탠드 E26 6종 당일발송 판매가 :139,000원 : 리뷰 :

[ONLY] 마켓비 MIRANS 가로 3문 수납장 NFM92120G 당일발송 판매가 :229,000원 소비자가 :269,000원 : 리뷰 :

마켓비 CHAMBER 벙커침대 더블 140200 KS1006BD/1 당일발송 판매가 :229,000원 소비자가 :279,000원 : 리뷰 :

[ONLY] 마켓비 MIRANS 서랍장 3단 CHM100100 브라운월넛베니어 당일발송 판매가 :199,000원 소비자가 :289,000원 : 리뷰 :

마켓비 MARINO 펜스침대 싱글 100200 KS1015BD 당일발송 판매가 :119,000원 : 리뷰 :

[ONLY] 마켓비 MILKAM 콘솔수납장 17585 CHM85175 당일발송 판매가 :339,000원 소비자가 :449,000원 : 리뷰 :

마켓비 KOBE 침대 퀸 150200 KS1050BD/2 당일발송 판매가 :159,000원 : 리뷰 :

[ONLY] 마켓비 ZERAVITY 리클라이너 1인소파 당일발송 판매가 :249,000원 소비자가 :685,000원 : 리뷰 :

마켓비 NORESUND 침대 퀸 150200 KS1024BD/2 당일발송 판매가 :229,000원 : 리뷰 :

[ONLY] 마켓비 LEILA 침대 퀸 150200 KS1022BD 화이트 당일발송 판매가 :209,000원 소비자가 :289,000원 : 리뷰 :

마켓비 PEMBA 시리즈 당일발송 판매가 :79,900원 : 리뷰 :

[ONLY] 마켓비 GRUET 트롤리 원형 2단 당일발송 판매가 :39,900원 소비자가 :49,900원 : 리뷰 :

[ONLY] 마켓비 DUKUN 트롤리 2단 10060 당일발송 판매가 :149,000원 소비자가 :169,000원 : 리뷰 :

package crawling.practice.app;

import java.io.IOException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public class JsoupPractice02 {
	public static void main(String[] args) throws IOException {
	
		String url = "https://marketb.kr/board/free/list.html?board_no=1" ;
		
		Document doc = Jsoup.connect(url).get();
		
		Elements ele = doc.select(".boardList>table");
		Elements thead = ele.select("thead>tr");
		
		for(Element e : thead) {
			System.out.println(e.select("th").text());
		}
		System.out.println("=========================================================");
        
		for(Element e : ele.select("tbody>tr")) {
        	System.out.println(e.select("td").text());
        	System.out.println("---------------------------------------------------------");
		}			
	}
        
	}
}
번호 카테고리 제목 작성자 날짜 조회수 추천 평점
=========================================================
[공지] 마켓비 5월 공식몰 회원 단독 혜택! 마켓비(JHK) 2021-04-30 426569 0 
---------------------------------------------------------
[이벤트] 2021년 5월 카드사 무이자할부 안내 마켓비(DSP) 2021-04-30 12941 0 
---------------------------------------------------------
[이벤트] 네이버페이 구매평쓰면 포인트 쏜다! 마켓비(SGP) 2021-04-30 9986 0 
---------------------------------------------------------
[이벤트] 5월 베스트리뷰어 참여하고 적립금 받자! 마켓비(HAB) 2021-04-30 98038 0 
---------------------------------------------------------
[모집] 인테리어 풀패키지 서비스! 시공부터 마케팅까지 손쉽게 해결하세요 마켓비(HAB) 2021-04-30 10387 0 
---------------------------------------------------------
[이벤트] 마켓비에서 롯데 롤라카드로 구매하고 최대 10만원 혜택 받아가세요! 마켓비(MKT) 2021-04-30 848 0 
---------------------------------------------------------
[이벤트] 5월에 마켓비 가입하면 인기상품이 0원! 마켓비(MKT) 2021-04-30 27 0 
---------------------------------------------------------
[공지사항] 배송정책 안내 운영자(design) 2021-01-21 26639 0 
---------------------------------------------------------
[대리점모집] 성공비결 마켓비! 오프라인 스토어 창업자 모집 마켓비(JHK) 2020-12-31 1348 0 
---------------------------------------------------------
[공지] 조립 배송 서비스 안내 마켓비(MKT) 2020-11-16 412 0 
---------------------------------------------------------
[모집] Recruitment of MARKETB's overseas partners 마켓비(HAB) 2018-10-23 689 0 
---------------------------------------------------------
[공지사항] AS정책 운영자(DP) 2016-07-13 12954 0 
---------------------------------------------------------
[공지사항] 전국 마켓비 대리점 현황 마켓비(DSP) 2017-09-19 57298 0 
---------------------------------------------------------

간만에 자바스크립트 탐색자도 써보고 재밌었당

내일은 로그인해서 스크랩핑 하는거 연습해보고

어떻게 파싱해서 db에 저장할지 구상해봐야겠다

'JAVA' 카테고리의 다른 글

[Spring] 스프링 빈 순환 참조  (0) 2021.05.07
JUnit Mockito Framework  (0) 2021.04.27
[JAVA] 복습!  (0) 2020.07.01
[JAVA Basic] Generic  (1) 2020.05.22
Batch ?
  • 일괄처리를 의미합니다.
  • 대용량 데이터를 고성능으로 처리합니다.
  • 자동화로 사용자의 개입 없이 처리할 수 있습니다.
  • 잘못된 데이터를 충돌, 중단 없이 처리합니다.
  • 추적 가능한 logging과 알림으로 신뢰성이 높습니다.

주의사항
  • 복잡한 로직을 피해야합니다.
  • 처리 데이터에 대한 예외 상황이 발생하지 않도록 무결성을 보장해야 합니다.
  • 네트워크 비용을 절감해야합니다.
💥Spring Boot Batch는 Scheduler를 제공하지 않습니다!
  • 구현된 Spring Boot Batch를 별도의 Scheduling Framework에 적용하여 원하는 시간 혹은 이벤트 상황에서 실행하고 이력을 관리해야 합니다.

 

batch의 job과 step의 관계는 이해했다.

job안에 steps가 포함되어있고 step은 tasklet이나 [reader|prossecor|writer] 를 통해 작업을 수행한다.

package batch.practice;

import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;

@EnableBatchProcessing
@SpringBootApplication
//@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
public class SpringBatchExample210428001Application {

	public static void main(String[] args) {
		SpringApplication.run(SpringBatchExample210428001Application.class, args);
	}

}
package batch.practice.job;

import org.springframework.batch.core.Job;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
import org.springframework.batch.repeat.RepeatStatus;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@RequiredArgsConstructor
@Configuration
public class SimpleJobConfiguration {
	private final JobBuilderFactory jobBuilderFactory;
	private final StepBuilderFactory stepBuilderFactory;
	
	@Bean
	public Job simpleJob () {
		return jobBuilderFactory.get("job001")
				.start(simpleStep01())
				.build();
	}
	
	@Bean
	public Step simpleStep01 () {
		return stepBuilderFactory.get("step001")
				.tasklet((contribution, chunkContext) -> {
					log.info("++++++++++ step001 excute ++++++++++");
					return RepeatStatus.FINISHED;
				})
				.build();
	}
	
}

MySQL DB와 연동하기 위해서 dependencies 추가 설정

build.gradle
plugins {
	id 'org.springframework.boot' version '2.3.10.RELEASE'
	id 'io.spring.dependency-management' version '1.0.11.RELEASE'
	id 'java'
}

group = 'batch'
version = '21.04.30.001 batch practice'
sourceCompatibility = '1.8'

configurations {
	compileOnly {
		extendsFrom annotationProcessor
	}
}

repositories {
	mavenCentral()
}

dependencies {
	implementation 'org.springframework.boot:spring-boot-starter-batch'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    compileOnly 'org.projectlombok:lombok'
    runtimeOnly 'com.h2database:h2'
    runtimeOnly 'mysql:mysql-connector-java'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testImplementation 'org.springframework.batch:spring-batch-test'
}

test {
	useJUnitPlatform()
}

MySQL DB에 Spring Batch Metadata Table들을 생성했다.

  • batch가 동작하는데에 꼭 필요함!
  • H2DB의 경우 boot시 자동으로 생성해주지만 Oracle, MySQL DB는 schema를 찾아 수동으로 생성해야한다.
schema-mysql.sql
-- Autogenerated: do not edit this file

CREATE TABLE BATCH_JOB_INSTANCE  (
	JOB_INSTANCE_ID BIGINT  NOT NULL PRIMARY KEY ,
	VERSION BIGINT ,
	JOB_NAME VARCHAR(100) NOT NULL,
	JOB_KEY VARCHAR(32) NOT NULL,
	constraint JOB_INST_UN unique (JOB_NAME, JOB_KEY)
) ENGINE=InnoDB;

CREATE TABLE BATCH_JOB_EXECUTION  (
	JOB_EXECUTION_ID BIGINT  NOT NULL PRIMARY KEY ,
	VERSION BIGINT  ,
	JOB_INSTANCE_ID BIGINT NOT NULL,
	CREATE_TIME DATETIME(6) NOT NULL,
	START_TIME DATETIME(6) DEFAULT NULL ,
	END_TIME DATETIME(6) DEFAULT NULL ,
	STATUS VARCHAR(10) ,
	EXIT_CODE VARCHAR(2500) ,
	EXIT_MESSAGE VARCHAR(2500) ,
	LAST_UPDATED DATETIME(6),
	JOB_CONFIGURATION_LOCATION VARCHAR(2500) NULL,
	constraint JOB_INST_EXEC_FK foreign key (JOB_INSTANCE_ID)
	references BATCH_JOB_INSTANCE(JOB_INSTANCE_ID)
) ENGINE=InnoDB;

CREATE TABLE BATCH_JOB_EXECUTION_PARAMS  (
	JOB_EXECUTION_ID BIGINT NOT NULL ,
	TYPE_CD VARCHAR(6) NOT NULL ,
	KEY_NAME VARCHAR(100) NOT NULL ,
	STRING_VAL VARCHAR(250) ,
	DATE_VAL DATETIME(6) DEFAULT NULL ,
	LONG_VAL BIGINT ,
	DOUBLE_VAL DOUBLE PRECISION ,
	IDENTIFYING CHAR(1) NOT NULL ,
	constraint JOB_EXEC_PARAMS_FK foreign key (JOB_EXECUTION_ID)
	references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
) ENGINE=InnoDB;

CREATE TABLE BATCH_STEP_EXECUTION  (
	STEP_EXECUTION_ID BIGINT  NOT NULL PRIMARY KEY ,
	VERSION BIGINT NOT NULL,
	STEP_NAME VARCHAR(100) NOT NULL,
	JOB_EXECUTION_ID BIGINT NOT NULL,
	START_TIME DATETIME(6) NOT NULL ,
	END_TIME DATETIME(6) DEFAULT NULL ,
	STATUS VARCHAR(10) ,
	COMMIT_COUNT BIGINT ,
	READ_COUNT BIGINT ,
	FILTER_COUNT BIGINT ,
	WRITE_COUNT BIGINT ,
	READ_SKIP_COUNT BIGINT ,
	WRITE_SKIP_COUNT BIGINT ,
	PROCESS_SKIP_COUNT BIGINT ,
	ROLLBACK_COUNT BIGINT ,
	EXIT_CODE VARCHAR(2500) ,
	EXIT_MESSAGE VARCHAR(2500) ,
	LAST_UPDATED DATETIME(6),
	constraint JOB_EXEC_STEP_FK foreign key (JOB_EXECUTION_ID)
	references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
) ENGINE=InnoDB;

CREATE TABLE BATCH_STEP_EXECUTION_CONTEXT  (
	STEP_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY,
	SHORT_CONTEXT VARCHAR(2500) NOT NULL,
	SERIALIZED_CONTEXT TEXT ,
	constraint STEP_EXEC_CTX_FK foreign key (STEP_EXECUTION_ID)
	references BATCH_STEP_EXECUTION(STEP_EXECUTION_ID)
) ENGINE=InnoDB;

CREATE TABLE BATCH_JOB_EXECUTION_CONTEXT  (
	JOB_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY,
	SHORT_CONTEXT VARCHAR(2500) NOT NULL,
	SERIALIZED_CONTEXT TEXT ,
	constraint JOB_EXEC_CTX_FK foreign key (JOB_EXECUTION_ID)
	references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
) ENGINE=InnoDB;

CREATE TABLE BATCH_STEP_EXECUTION_SEQ (
	ID BIGINT NOT NULL,
	UNIQUE_KEY CHAR(1) NOT NULL,
	constraint UNIQUE_KEY_UN unique (UNIQUE_KEY)
) ENGINE=InnoDB;

INSERT INTO BATCH_STEP_EXECUTION_SEQ (ID, UNIQUE_KEY) select * from (select 0 as ID, '0' as UNIQUE_KEY) as tmp where not exists(select * from BATCH_STEP_EXECUTION_SEQ);

CREATE TABLE BATCH_JOB_EXECUTION_SEQ (
	ID BIGINT NOT NULL,
	UNIQUE_KEY CHAR(1) NOT NULL,
	constraint UNIQUE_KEY_UN unique (UNIQUE_KEY)
) ENGINE=InnoDB;

INSERT INTO BATCH_JOB_EXECUTION_SEQ (ID, UNIQUE_KEY) select * from (select 0 as ID, '0' as UNIQUE_KEY) as tmp where not exists(select * from BATCH_JOB_EXECUTION_SEQ);

CREATE TABLE BATCH_JOB_SEQ (
	ID BIGINT NOT NULL,
	UNIQUE_KEY CHAR(1) NOT NULL,
	constraint UNIQUE_KEY_UN unique (UNIQUE_KEY)
) ENGINE=InnoDB;

INSERT INTO BATCH_JOB_SEQ (ID, UNIQUE_KEY) select * from (select 0 as ID, '0' as UNIQUE_KEY) as tmp where not exists(select * from BATCH_JOB_SEQ);

Run 했을 경우의 error log
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.4.5)

2021-04-28 16:55:19.464  INFO 19748 --- [  restartedMain] p.SpringBatchExample210428001Application : Starting SpringBatchExample210428001Application using Java 15.0.2 on DESKTOP-C7P9M2O with PID 19748 (--- \springBatchExample210428001\bin\main started by *** in --- \springBatchExample210428001)
2021-04-28 16:55:19.469  INFO 19748 --- [  restartedMain] p.SpringBatchExample210428001Application : No active profile set, falling back to default profiles: default
2021-04-28 16:55:19.550  INFO 19748 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2021-04-28 16:55:19.550  INFO 19748 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2021-04-28 16:55:20.736  INFO 19748 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2021-04-28 16:55:20.739  INFO 19748 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JDBC repositories in DEFAULT mode.
2021-04-28 16:55:20.752  INFO 19748 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 8 ms. Found 0 JDBC repository interfaces.
2021-04-28 16:55:20.769  INFO 19748 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2021-04-28 16:55:20.771  INFO 19748 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-04-28 16:55:20.782  INFO 19748 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 3 ms. Found 0 JPA repository interfaces.
2021-04-28 16:55:21.584  INFO 19748 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2021-04-28 16:55:21.600  INFO 19748 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2021-04-28 16:55:21.601  INFO 19748 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.45]
2021-04-28 16:55:21.810  INFO 19748 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2021-04-28 16:55:21.811  INFO 19748 --- [  restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2259 ms
2021-04-28 16:55:21.918  WARN 19748 --- [  restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'inMemoryDatabaseShutdownExecutor' defined in class path resource [org/springframework/boot/devtools/autoconfigure/DevToolsDataSourceAutoConfiguration.class]: Unsatisfied dependency expressed through method 'inMemoryDatabaseShutdownExecutor' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: com.mysql.cj.jdbc.Driver
2021-04-28 16:55:21.922  INFO 19748 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2021-04-28 16:55:21.942  INFO 19748 --- [  restartedMain] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-04-28 16:55:21.978 ERROR 19748 --- [  restartedMain] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'inMemoryDatabaseShutdownExecutor' defined in class path resource [org/springframework/boot/devtools/autoconfigure/DevToolsDataSourceAutoConfiguration.class]: Unsatisfied dependency expressed through method 'inMemoryDatabaseShutdownExecutor' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: com.mysql.cj.jdbc.Driver
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:541) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1334) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.6.jar:5.3.6]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.6.jar:5.3.6]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.6.jar:5.3.6]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144) ~[spring-boot-2.4.5.jar:2.4.5]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:782) ~[spring-boot-2.4.5.jar:2.4.5]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:774) ~[spring-boot-2.4.5.jar:2.4.5]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439) ~[spring-boot-2.4.5.jar:2.4.5]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:339) ~[spring-boot-2.4.5.jar:2.4.5]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1340) ~[spring-boot-2.4.5.jar:2.4.5]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1329) ~[spring-boot-2.4.5.jar:2.4.5]
	at batch.practice.SpringBatchExample210428001Application.main(SpringBatchExample210428001Application.java:15) ~[main/:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na]
	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-2.4.5.jar:2.4.5]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: com.mysql.cj.jdbc.Driver
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1334) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ~[spring-beans-5.3.6.jar:5.3.6]
	... 27 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: com.mysql.cj.jdbc.Driver
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.6.jar:5.3.6]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.6.jar:5.3.6]
	... 41 common frames omitted
Caused by: java.lang.IllegalStateException: Cannot load driver class: com.mysql.cj.jdbc.Driver
	at org.springframework.util.Assert.state(Assert.java:97) ~[spring-core-5.3.6.jar:5.3.6]
	at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.determineDriverClassName(DataSourceProperties.java:224) ~[spring-boot-autoconfigure-2.4.5.jar:2.4.5]
	at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.initializeDataSourceBuilder(DataSourceProperties.java:176) ~[spring-boot-autoconfigure-2.4.5.jar:2.4.5]
	at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration.createDataSource(DataSourceConfiguration.java:48) ~[spring-boot-autoconfigure-2.4.5.jar:2.4.5]
	at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari.dataSource(DataSourceConfiguration.java:90) ~[spring-boot-autoconfigure-2.4.5.jar:2.4.5]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.6.jar:5.3.6]
	... 42 common frames omitted

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'inMemoryDatabaseShutdownExecutor' defined in class path resource [org/springframework/boot/devtools/autoconfigure/DevToolsDataSourceAutoConfiguration.class]: Unsatisfied dependency expressed through method 'inMemoryDatabaseShutdownExecutor' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: com.mysql.cj.jdbc.Driver
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: com.mysql.cj.jdbc.Driver
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: com.mysql.cj.jdbc.Driver
Caused by: java.lang.IllegalStateException: Cannot load driver class: com.mysql.cj.jdbc.Driver

properties나 java codes를 변경해도 error에 변화가 없다...

뭐가 잘못됐을까!?

spring batch 공부도 할 겸 batch job, step 작성부터 다시 시작해봐야겠다! 😫


210430

external Dependencies를 확인해보니 mysql connector가 없어서

gradle>refresh gradle project 해주니 의존성 추가가 되었다!

잘 연결됩니당 ☺👍👍👍!!

 

Spring Batch를 통해 1~100까지 로그로 출력하기

package batch.practice.job;

import org.springframework.batch.core.Job;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
import org.springframework.batch.repeat.RepeatStatus;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

@Slf4j						//log 사용을 위한 lombok annotation
@RequiredArgsConstructor	//생성자 DI를 위한 lombok annotation
@Configuration				//Spring batch의 Job은 @Configuration annotation으로 등록 후 사용
public class SimpleJobConfiguration002 {
	private final JobBuilderFactory jobBuilderFactory;
	private final StepBuilderFactory stepBuilderFactory;
			
	@Bean
	public Job simpleJob1() {
		log.info("========== START simpleJob");

		return jobBuilderFactory.get("simpleJob1")	//Batch Job을 생성하고 builder를 통해 이름 지정
				.start(simpleStep1())				//execute 할 step or sequence of steps
				.build();
	};
	
	
			
	@Bean
	public Step simpleStep1() {
		return stepBuilderFactory.get("simpleStep1")			//Batch Step을 생성하고 builder를 통해 이름 지정
				.tasklet((contribution, chunkContext) -> {		//Step 안에서 수행될 기능을 명시
					for(int i = 0; i < 100 ; i ++) {			//	- Tasklet은 Step 안에서 단일로 수행될 커스텀 기능 선언
					log.info(">>>>>  "+(i+1)+"  <<<<<");
					}					
					return RepeatStatus.FINISHED;
				})
				.build();				
	};
					
};
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.4.5)

2021-04-27 13:42:11.560  INFO 27484 --- [  restartedMain] b.p.BatchExample210427001Application     : Starting BatchExample210427001Application using Java 15.0.2 on DESKTOP-C7P9M2O with PID 27484 (-)
2021-04-27 13:42:11.564  INFO 27484 --- [  restartedMain] b.p.BatchExample210427001Application     : No active profile set, falling back to default profiles: default
2021-04-27 13:42:11.642  INFO 27484 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2021-04-27 13:42:12.367  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : ========== START simpleJob
2021-04-27 13:42:12.583  INFO 27484 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2021-04-27 13:42:12.605  INFO 27484 --- [  restartedMain] b.p.BatchExample210427001Application     : Started BatchExample210427001Application in 1.483 seconds (JVM running for 3.024)
2021-04-27 13:42:12.607  INFO 27484 --- [  restartedMain] o.s.b.a.b.JobLauncherApplicationRunner   : Running default command line with: []
2021-04-27 13:42:12.608  WARN 27484 --- [  restartedMain] o.s.b.c.c.a.DefaultBatchConfigurer       : No datasource was provided...using a Map based JobRepository
2021-04-27 13:42:12.608  WARN 27484 --- [  restartedMain] o.s.b.c.c.a.DefaultBatchConfigurer       : No transaction manager was provided, using a ResourcelessTransactionManager
2021-04-27 13:42:12.628  INFO 27484 --- [  restartedMain] o.s.b.c.l.support.SimpleJobLauncher      : No TaskExecutor has been set, defaulting to synchronous executor.
2021-04-27 13:42:12.662  INFO 27484 --- [  restartedMain] o.s.b.c.l.support.SimpleJobLauncher      : Job: [SimpleJob: [name=simpleJob1]] launched with the following parameters: [{}]
2021-04-27 13:42:12.700  INFO 27484 --- [  restartedMain] o.s.batch.core.job.SimpleStepHandler     : Executing step: [simpleStep1]
2021-04-27 13:42:12.711  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  1  <<<<<
2021-04-27 13:42:12.712  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  2  <<<<<
2021-04-27 13:42:12.712  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  3  <<<<<
2021-04-27 13:42:12.712  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  4  <<<<<
2021-04-27 13:42:12.712  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  5  <<<<<
2021-04-27 13:42:12.712  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  6  <<<<<
2021-04-27 13:42:12.712  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  7  <<<<<
2021-04-27 13:42:12.712  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  8  <<<<<
2021-04-27 13:42:12.712  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  9  <<<<<
2021-04-27 13:42:12.712  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  10  <<<<<
2021-04-27 13:42:12.712  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  11  <<<<<
2021-04-27 13:42:12.712  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  12  <<<<<
2021-04-27 13:42:12.712  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  13  <<<<<
2021-04-27 13:42:12.713  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  14  <<<<<
2021-04-27 13:42:12.713  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  15  <<<<<
2021-04-27 13:42:12.713  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  16  <<<<<
2021-04-27 13:42:12.713  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  17  <<<<<
2021-04-27 13:42:12.713  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  18  <<<<<
2021-04-27 13:42:12.713  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  19  <<<<<
2021-04-27 13:42:12.713  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  20  <<<<<
2021-04-27 13:42:12.713  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  21  <<<<<
2021-04-27 13:42:12.713  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  22  <<<<<
2021-04-27 13:42:12.713  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  23  <<<<<
2021-04-27 13:42:12.713  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  24  <<<<<
2021-04-27 13:42:12.713  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  25  <<<<<
2021-04-27 13:42:12.713  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  26  <<<<<
2021-04-27 13:42:12.713  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  27  <<<<<
2021-04-27 13:42:12.713  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  28  <<<<<
2021-04-27 13:42:12.714  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  29  <<<<<
2021-04-27 13:42:12.714  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  30  <<<<<
2021-04-27 13:42:12.714  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  31  <<<<<
2021-04-27 13:42:12.714  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  32  <<<<<
2021-04-27 13:42:12.714  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  33  <<<<<
2021-04-27 13:42:12.714  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  34  <<<<<
2021-04-27 13:42:12.714  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  35  <<<<<
2021-04-27 13:42:12.714  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  36  <<<<<
2021-04-27 13:42:12.714  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  37  <<<<<
2021-04-27 13:42:12.714  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  38  <<<<<
2021-04-27 13:42:12.715  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  39  <<<<<
2021-04-27 13:42:12.715  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  40  <<<<<
2021-04-27 13:42:12.715  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  41  <<<<<
2021-04-27 13:42:12.715  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  42  <<<<<
2021-04-27 13:42:12.715  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  43  <<<<<
2021-04-27 13:42:12.715  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  44  <<<<<
2021-04-27 13:42:12.715  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  45  <<<<<
2021-04-27 13:42:12.715  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  46  <<<<<
2021-04-27 13:42:12.715  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  47  <<<<<
2021-04-27 13:42:12.715  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  48  <<<<<
2021-04-27 13:42:12.715  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  49  <<<<<
2021-04-27 13:42:12.715  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  50  <<<<<
2021-04-27 13:42:12.715  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  51  <<<<<
2021-04-27 13:42:12.715  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  52  <<<<<
2021-04-27 13:42:12.715  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  53  <<<<<
2021-04-27 13:42:12.715  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  54  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  55  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  56  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  57  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  58  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  59  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  60  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  61  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  62  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  63  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  64  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  65  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  66  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  67  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  68  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  69  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  70  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  71  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  72  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  73  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  74  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  75  <<<<<
2021-04-27 13:42:12.716  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  76  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  77  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  78  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  79  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  80  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  81  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  82  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  83  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  84  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  85  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  86  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  87  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  88  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  89  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  90  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  91  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  92  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  93  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  94  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  95  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  96  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  97  <<<<<
2021-04-27 13:42:12.717  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  98  <<<<<
2021-04-27 13:42:12.718  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  99  <<<<<
2021-04-27 13:42:12.718  INFO 27484 --- [  restartedMain] b.p.job.SimpleJobConfiguration002        : >>>>>  100  <<<<<
2021-04-27 13:42:12.727  INFO 27484 --- [  restartedMain] o.s.batch.core.step.AbstractStep         : Step: [simpleStep1] executed in 27ms
2021-04-27 13:42:12.735  INFO 27484 --- [  restartedMain] o.s.b.c.l.support.SimpleJobLauncher      : Job: [SimpleJob: [name=simpleJob1]] completed with the following parameters: [{}] and the following status: [COMPLETED] in 42ms

 

사실 1개의 step에서 for문을 이용하여 1~100까지 출력하는 방식이 아니라

job이 작동하면 step을 100개 생성해서 각각 1~100까지 출력하게 만들고 싶었다.

이 생각이 틀렸는지 더 공부해서 만약 가능하다면 시도해봐야겠다!!

+ Recent posts