13,200원
다른 수강생들이 자주 물어보는 질문이 궁금하신가요?
- 해결됨[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
설정 관련 문의
안녕하세요 강사님 스프링 배치 입문 강의 잘 보고 있습니다.스프링 부트에서는 첨부해드린 사진과 같이 설정을 Gradle이 아닌 IntelliJ IDEA 로 바꾸면 실행 속도가 더 빠르다 해서이번 스프링 배치에서도 이와 같이 설정했더니 bean 관련 에러가 나면서 실행이 안되더라고요ㅠ빈 이름도 오타없이 정확하게 입력했기에 한참을 헤매다 해당 설정을 기존과 같이 Gradle로 바꿨더니 문제없이 실행이 되었습니다.혹시 해당 현상에 대해 이유를 알고 계시다면 알려주실 수 있나요??감사합니다!
- 해결됨[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
다중DB 접속 설정 에러
안녕하세요!강의 잘 봤습니다!강의 보고 다중DB를 설정하는과정에서 에러가나서 질문드려요여기서 하면 안되는거같은데 ... 도움부탁드릴려고 글 남깁니다!targetDb에서 select는 정상적으로 들어오는데 localDB save 할때 할당 문제인거 같은데 ...에로코드org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is java.lang.IllegalStateException: Already value [org.springframework.jdbc.datasource.ConnectionHolder@4ff98dfc] for key [HikariDataSource (HikariPool-1)] bound to thread [scheduling-1] at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:467) ~[spring-orm-5.3.6.jar:5.3.6] at org.springframework.transaction.support.AbstractPlatformTransactionManager.startTransaction(AbstractPlatformTransactionManager.java:400) ~[spring-tx-5.3.6.jar:5.3.6] at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) ~[spring-tx-5.3.6.jar:5.3.6] at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:595) ~[spring-tx-5.3.6.jar:5.3.6] at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:382) ~[spring-tx-5.3.6.jar:5.3.6] ------ at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) [spring-context-5.3.6.jar:5.3.6] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-5.3.6.jar:5.3.6] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_181] at java.util.concurrent.FutureTask.runAndReset$$$capture(FutureTask.java:308) [na:1.8.0_181] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java) [na:1.8.0_181] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_181] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_181] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_181] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_181] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_181] Caused by: java.lang.IllegalStateException: Already value [org.springframework.jdbc.datasource.ConnectionHolder@4ff98dfc] for key [HikariDataSource (HikariPool-1)] bound to thread [scheduling-1] at org.springframework.transaction.support.TransactionSynchronizationManager.bindResource(TransactionSynchronizationManager.java:193) ~[spring-tx-5.3.6.jar:5.3.6] at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:442) ~[spring-orm-5.3.6.jar:5.3.6] ... 93 common frames omitted 2024-02-26 12:16:27.150 INFO 23616 --- [ scheduling-1] o.s.batch.core.step.AbstractStep : Step: [step] executed in 737ms 2024-02-26 12:16:27.160 INFO 23616 --- [ scheduling-1] c.m.mj_agent.listener.JobLoggerListener : taragetJob Job is Done. (Status: FAILED) 2024-02-26 12:16:27.160 INFO 23616 --- [ scheduling-1] c.m.mj_agent.listener.JobLoggerListener : Job is Failed 2024-02-26 12:16:27.168 INFO 23616 --- [ scheduling-1] o.s.b.c.l.support.SimpleJobLauncher : Job: [SimpleJob: [name=taragetJob]] completed with the following parameters: [{time=1708917386263}] and the following status: [FAILED] in 797ms localDbConfigpackage com.munjaon.mj_agent.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.orm.jpa.JpaTransactionManager; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; import org.springframework.transaction.PlatformTransactionManager; import javax.sql.DataSource; import java.util.HashMap; /** * */ @Configuration @PropertySource({ "classpath:application.yml" }) @EnableJpaRepositories( // basePackages = {"com.repia.collectweb.common", "com.repia.collectweb.schedule"}, // basePackages = {"com.munjaon.mj_agent.batch.local.repo"}, basePackages = {"com.munjaon.mj_agent.batch.local"}, entityManagerFactoryRef = "primaryEntityManager", transactionManagerRef = "primaryTransactionManager" ) public class LocalDbConfig { @Autowired private Environment env; @Bean @Primary @ConfigurationProperties(prefix = "spring.local-datasource.datasource.hikari") public DataSource primaryDataSource() { return DataSourceBuilder.create().build(); } @Bean @Primary public LocalContainerEntityManagerFactoryBean primaryEntityManager() { LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean(); em.setDataSource(primaryDataSource()); em.setPackagesToScan(new String[] { "com.munjaon.mj_agent.batch.local.repo.entity" }); HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); em.setJpaVendorAdapter(vendorAdapter); HashMap<String, Object> properties = new HashMap<>(); properties.put("hibernate.show_sql", env.getProperty("spring.jpa.show_sql")); properties.put("hibernate.format_sql", env.getProperty("spring.jpa.format_sql")); properties.put("hibernate.use_sql_comments", env.getProperty("spring.jpa.use_sql_comments")); properties.put("hibernate.hbm2ddl.auto", env.getProperty("spring.jpa.hibernate.hbm2ddl.auto")); properties.put("hibernate.dialect", env.getProperty("spring.jpa.database-platform")); // properties.put("hibernate.dialect", env.getProperty("spring.jpa.database")); em.setJpaPropertyMap(properties); return em; } @Bean @Primary public PlatformTransactionManager primaryTransactionManager() { JpaTransactionManager transactionManager = new JpaTransactionManager(); transactionManager.setEntityManagerFactory(primaryEntityManager().getObject()); return transactionManager; } }TargetDbConfigpackage com.munjaon.mj_agent.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.orm.jpa.JpaTransactionManager; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.EnableTransactionManagement; import javax.sql.DataSource; import java.util.HashMap; import java.util.Objects; /** * */ @Configuration @PropertySource({ "classpath:application.yml" }) @EnableTransactionManagement @EnableJpaRepositories( basePackages = {"com.munjaon.mj_agent.batch.target.repo"} , entityManagerFactoryRef = "targetDbEntityManager" , transactionManagerRef = "targetDbTransactionManager" ) public class TargetDbConfig { @Autowired private Environment env; @Bean // @Primary public LocalContainerEntityManagerFactoryBean targetDbEntityManager() { LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean(); em.setDataSource(targetDbDataSource()); em.setPackagesToScan(new String[] { "com.munjaon.mj_agent.batch.target.repo.entity" }); HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); em.setJpaVendorAdapter(vendorAdapter); HashMap<String, Object> properties = new HashMap<>(); properties.put("hibernate.show_sql", env.getProperty("spring.jpa.show_sql")); properties.put("hibernate.format_sql", env.getProperty("spring.jpa.format_sql")); properties.put("hibernate.use_sql_comments", env.getProperty("spring.jpa.use_sql_comments")); // properties.put("hibernate.hbm2ddl.auto", false); // properties.put("hibernate.dialect", false); properties.put("hibernate.hbm2ddl.auto", env.getProperty("spring.jpa.hibernate.hbm2ddl.auto")); properties.put("hibernate.dialect", env.getProperty("spring.jpa.database-platform")); em.setJpaPropertyMap(properties); return em; } @Bean // @Primary @ConfigurationProperties(prefix = "spring.target-datasource.datasource.hikari") public DataSource targetDbDataSource() { return DataSourceBuilder.create().build(); } // @Primary // @Bean @Bean(name = "targetDbTransactionManager") public PlatformTransactionManager targetDbTransactionManager(EntityManagerFactoryBuilder builder) { return new JpaTransactionManager(Objects.requireNonNull(targetDbEntityManager().getObject())); } } 감사합니다!
- 미해결[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
조건별 분기 처리시 질문있습니다
.start(conditionalStartStep).on("FAILED").to(conditionalFailedStep).from(conditionalStartStep).on("COMPLETED").to(conditionalCompletedStep).from(conditionalStartStep).on("*").to(conditionalAllStep) 이때 오류 없이 성공하면 conditionalCompletedStep실패하게 되면 conditionalFailedStep 가게 되는데 마지막 줄의 "*" 표시는 어떨때 동작을 하게 만들 수 있을까요? 언뜻 보기에는 모든 상황에 대해서 발생하는거 처럼 보이는데 쉽사리 이해가 가지 않습니다
- 해결됨[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
Spring Batch 테이블이 생성되질 않습니다!!!!!
안녕하세요 강사님. 우선 강의 잘 들었다고 말씀드리고싶습니다.다름이 아니라, 프로젝트에 스프링 배치를 적용시켜보려합니다.아.. 근데 애플리케이션을 실행하면 기본으로 생성되는 배치 테이블이 생성되질 않습니다. (로컬에서는 h2 사용중입니다.) 현재로서는 임시방편으로 BatchProperties 에 나와있는대로 schema-h2.sql 내용을 복사해서 애플리케이션 구동 후, sql console 에 붙여넣기하여 배치 테이블을 직접 만들어주고있습니다. (이렇게 하면 배치랑 스케줄링이 정상적으로 잘 동작합니다.)현재 yml 은 아래와 같습니다. profile 에 따라 yml 을 분리시켜주었긴 했는데, 포맷은 똑같습니다!(defer-datasource-initialization 와 sql-init-mode 과 관련있나해서 이것도 바꿔보았는데.. 되질 않습니다ㅠㅠ)spring: profiles: active: local jpa: open-in-view: false hibernate: ddl-auto: create defer-datasource-initialization: true properties: hibernate: format_sql: true default_batch_fetch_size: 100 data: web: pageable: one-indexed-parameters: true datasource: url: jdbc:h2:tcp://localhost/~/apartribe;MODE=MySQL username: sa password: driver-class-name: org.h2.Driver sql: init: mode: always mail: host: smtp.gmail.com port: 587 username: EMAIL password: PASSWORD properties: mail: smtp: auth: true starttls: enable: true ssl: trust: "*" security: oauth2: client: registration: kakao: client-name: KOAuth2LoginDemo client-id: KAKAO_CLINET_ID client-secret: KAKAO_CLINET_SECRET client-authentication-method: client_secret_post redirect-uri: http://localhost:8080/login/oauth2/code/kakao authorization-grant-type: authorization_code scope: profile_nickname, profile_image, account_email, age_range, birthyear provider: kakao: authorization-uri: https://kauth.kakao.com/oauth/authorize token-uri: https://kauth.kakao.com/oauth/token user-info-uri: https://kapi.kakao.com/v1/oidc/userinfo user-name-attribute: sub batch: jdbc: initialize-schema: always job: enabled: false application: security: jwt: secret-key: ACCESS_TOKEN_SECRET_KEY expiration: ACCESS_TOKEN_EXPIRATION refresh-token: secret-key: REFRESH_TOKEN_SECRET_KEY expiration: REFRESH_TOKEN_EXPIRATION mail: subject: MAIL_SUBJECT logging: level: sql: debug cloud: aws: s3: bucket: AWS_BUCKET_NAME credentials: access-key: AWS_ACCESS_KEY secret-key: AWS_SECRET_KEY region: static: ap-northeast-2 auto: false stack: auto: false server: error: whitelabel: enabled: false include-exception: false include-message: never include-stacktrace: never include-binding-errors: never 프로젝트 주소는 아래와 같습니다.https://github.com/Revi1337/apartribe-backend Batch 와 Scheduling 설정의 위치는 아래와 같습니다src/main/java/kr/apartribebackend/global/config/BatchConfig.java 와src/main/java/kr/apartribebackend/global/config/SchedulingConfig.java 조언좀 부탁드리겠습니다 선생님..ㅠㅠ
- 미해결[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
db이관시 sql 스크립트 데이터 복붙하라고 하시는데 파일은 어디에 있나요 ?
db이관시 sql 스크립트 데이터 복붙하라고 하시는데 파일은 어디에 있나요 ?
- 미해결[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
Spring Batch5로 강의내용 최신화 업데이트될 가능성이 있을까요?
안녕하세요 혹시 Spring Batch5점대 최신버전으로 강의내용 업데이트 계획이 있을까요?
- 미해결[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
reader, writer, processor에서 적용
tasklet이 아닌 chunk 단위에서 step 간에 데이터 공유를 하고 싶다면 어떤 식으로 코드를 짜야 할까요 ?찾아보니 방법이 달라서 적용이 힘든데 궁금합니다..
- 미해결[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
똑같이 실행하는데 출력이 안돼요
@Configuration @RequiredArgsConstructor @Slf4j public class HelloWorldJdbcConfig { private final JobBuilderFactory jobBuilderFactory; //이걸 통해 JOb을 생성 private final StepBuilderFactory stepBuilderFactory; //Step 생성을 위해 /** * 두 객체를 활용하여 Job과 Step을 생성할꺼야 Job은 JobBuilderFactory로 만들고 Step은 StepBuilderFactory로 만들자. */ @Bean public Job helloWorldJob() { Job helloWorldJob = jobBuilderFactory.get("helloWorldJob") //이름을 정해주고 .incrementer(new RunIdIncrementer()) //Job을 실행할 때 id를 부여하는데, Sequence를 순차적으로 부여할 수 있도록 RunIdIncrementer를 해주자. .start(helloWorldStep()) //Job안에는 Step이 존재해야해. .build(); return helloWorldJob; } @JobScope @Bean public Step helloWorldStep() { TaskletStep helloWorldStep = stepBuilderFactory.get("helloWorldStep") //역시 똑같이 get을 통해 이름 명시 .tasklet(helloWorldTasklet()) //일단 간단하게 taskLet으로 해보자. .build(); return helloWorldStep; } @StepScope //step 하위에서 실행되기 때문에 @StepScope를 등록하자. @Bean public Tasklet helloWorldTasklet() { //Tasklet은 그냥 만들면 돼 Tasklet tasklet = new Tasklet() { @Override public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { //내가 원하는 작업 부분 System.out.println("Hello World Spring Batch"); log.info("asdasdasd"); log.info("batch start!!"); //원하는 작업이 끝난 이후 어떻게 할 것인가 ?에 대한 Status를 명시해야함. return RepeatStatus.FINISHED; // FINISHED를 명시함으로써 이 Step을 끝낸다는 뜻. } }; return tasklet; } /** * 위 과정을 모두 다 했다면 * HelloWorld를 보기 위한 하나의 Job이 완성이 된 것이다 ! * 스프링을 실행해서 출력이 되는지 확인하자 !! * Job을 실행시킬 때는 properties에서 설정한 batch.job.names를 파라미터로 넘겨주어야 Job이 실행이 된다. * 위에서 Job 이름은 helloWorldJob이기 때문에 파라미터로 넣어주자 ! *Edit Configurations > Program Parameters에 --spring.batch.job.names=helloWorldJob을 넣어주자. * 그러고 실행하면 돼 ! */ /** * 또한 Job을 실행할 때는 * apllication.properties에 설정한 * spring.batch.job.names에 파라미터로 넘겨주어야 job이 실행이 된다. * --spring.batch.job.names={이름} 이런 식으로 넘겨줘야해 * 내가 현재 설정한 job의 이름은 helloWorldJob이기 때문에 해당 값을 넣어서 파라미터 등록하자. */ }위 코드를 작성한 후에 main에서 @EnableBatchProcessing 어노테이션을 추가해주고 실행하였습니다.또한 application.properties에 spring.batch.job.names=${job.name:NONE}넣어준 후 parameter 까지 제대로 넣어주었는데 실행하면 해당 출력문이 나오지 않습니다.. 뭐가 문제인지 몰라서 질문드립니다.. !
- 미해결[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
스케줄러에서 Job을 구분하지 못합니다.
강의 잘 들었습니다!마지막 강의 실행 부분에서 문제가 생겼는데요작성하신 코드와 똑같이 진행했음에도 실행 시"Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed"라는 에러가 나버립니다.제 생각엔 만들어둔 Job이 7개라어떤 Job을 실행시켜야할 지 정하지 못해 나는|에러처럼 보입니다.예상컨데 helloWorldJob이 HelloWorldJobConfig 클래스에서 만든 잡의이름이라고 보는데, 저도 똑같이 했는데왜 이런 에러가 날까요?@Qualifier("helloWorldJob")private final Job helloWorldJob;를 사용해봐도 여전히 에러가 납니다.
- 미해결[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
빌드가 실패해요 ㅠㅠ
안녕하세요!강의와는 조금 다르게 java11과 springboot 2.7.13(snapshot)으로 진행해봤는데요.빌드가 계속 실패합니다 ㅠhttps://github.com/chojuyeon94/SpringBatchTutorialorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'batchDataSourceInitializer' defined in class path resource [org/springframework/boot/autoconfigure/batch/BatchAutoConfiguration$DataSourceInitializerConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.batch.BatchDataSourceScriptDatabaseInitializer]: Factory method 'batchDataSourceInitializer' threw exception; nested exception is java.lang.IllegalStateException: Unable to detect database type데이터베이스 타입을 찾을 수 없다고 나오는데요이게 데이터베이스에 연결이 잘 안되는거라고 해서 여러 방법을 써봤는데 잘 안되서 글 남깁니다!!
- 미해결[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
Chunk size에 대해
안녕하세요.코드를 보면 Step을 만들 때, .<Orders, Accounts>chunk(5) 와 같이 chunk size를 5로 지정했는데요.ItemReader에서도 PageSize를 5개로 지정했습니다.그리고 실제로 배치를 실행하면 정상적으로 동작합니다.하지만, 로그를 보면 select와 insert가 섞여있는데요.5개씩 실행되는게 어느 단위인지 궁금합니다.1. Reader에서 5개를 읽어온다.2. 5개를 Processcor에서 처리한다.3. 5개를 Writer에서 DB에 작성한다.저는 위와 같은 방식이라고 생각했는데, 어떤게 맞는건가요?좋은 강의 감사합니다!
- 미해결[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
Run / Debug 관련 질문드립니다..!
앞선 질문 보고 다음과 같이 추가를 한 상황인데 Hello World Spring Batch 구문이 실행이 되지 않아 질문을 드립니다..! 혹시 제가 잘못 설정한 부분이 있는 걸까요?
- 미해결[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
완강했습니다! 마지막 질문 드리고 싶습니다.
스프링에서 제공하는 스케쥴링은 배치에서 제공하는 기능이 아닌건가요? 그리고 제가 현재 전자책 사이트를 만들어 볼려고 하는데 주간 베스트, 월간 베스트 조회 기능을 넣고자 하는데이를 배치와 스케줄링으로 해봐야겠다! 라고 생각한게 적절한지 여쭙고 싶습니다! 좋은 강의 감사합니다.
- 미해결[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
여러개의 step 구동 질문
각 step에서 비즈니스 로직을 분리하고SRP를 준수하기 위한 작업으로 이해하는 것이 맞을까요?!
- 미해결[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
이번 작업과 관련하여 질문이 있습니다.
보통 이번 작업을 통해서 레디스에 있는 캐시를 배치로 다시 갱신하는 용도로 사용하나요??
- 미해결[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
잡 이름이 겹치지 않는데 왜 이럴까요...?
Parameter 0 of method jobListenerJob in com.example.demo.job.jobListener.JobListenerConfig required a single bean, but 3 were found: - helloWorldStep: defined in BeanDefinition defined in class path resource [com/example/demo/job/helloworld/HelloWorldJobConfig.class] - JobListenerStep: defined in BeanDefinition defined in class path resource [com/example/demo/job/jobListener/JobListenerConfig.class] - validatedParamStep: defined in BeanDefinition defined in class path resource [com/example/demo/job/validatedParam/ValidatedParamConfig.classJob이 전혀다르고 실행 시 Job 이름도 인수로 다르게 넘겨줬는데 계속 이게 나오는데 @Primary를 쓰지 않고 실행하려면 어떻게 해야할까요..?
- 미해결[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
테스트 코드 실행 시 에러
안녕하세요.success_noData() 테스트 코드를 테스트 하는 중에 에러가 발생하여 질문 남겨봅니다! 에러는 다음과 같습니다! Description:Parameter 0 of constructor in com.example.SpringBatchTutorial.job.dbDataReadWrite.TrMigrationConfig required a bean of type 'com.example.SpringBatchTutorial.core.domain.orders.OrdersRepository' that could not be found.Action:Consider defining a bean of type 'com.example.SpringBatchTutorial.core.domain.orders.OrdersRepository' in your configuration. 이와 같은 에러가 발생하는데 해결 방법을 부탁드립니다!
- 미해결[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
예제 프로젝트
혹시 예제 프로젝트는 없는건가요,,,?
- 미해결[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
JobLauncher의 의존성 주입
이렇게 RequiredArgsConstructor를 이용해서 빈 주입을 받으면 괜찮은데 강사님 처럼이렇게 주입을 받을려고 하면 jobLauncher의 의존성 주입이 되지 않더라고요 이 부분 질문 드립니다!
- 미해결[스프링 배치 입문] 예제로 배우는 핵심 Spring Batch
동시성 문제
좋은 강의 완강하였습니다!질문이 있어서 남깁니다.(모두 강의처럼 설정하고 jobscheduler 사용시 가정입니다)배치 작업이 진행될 때 동시에 다른 배치 작업이 진행된다면 동시성문제가 일어날 수 있나요??한마디로 주기설정시에 모두 겹치지 않게 주기를 설정해야하나요??예를 들어 데이터를 읽어오는 job이 실행이 될 때 그 데이터에 관해서 update나 create delete쿼리가 날라온다면 에러가 터지나요??아니면 배치작업이 먼저 일어났으니까 배치 작업이 끝나고 날라온 쿼리가 작용되나요??만약 이런 문제가 있다면 배치작업은 항상 서비스 점검시간을 두어 진행되야 하나요??