Spring Batch 5.0 Migration Guide

이 문서는 애플리케이션을 스프링 배치 5.0으로 마이그레이션하는 데 도움을 주기 위한 것이다.

Major changes

JDK 17 baseline

스프링 배치 5는 자바 17을 최소 버전으로 요구하는 스프링 프레임워크 6을 기반으로 한다. 따라서 스프링 배치 5 애플리케이션을 실행하려면 자바 17+를 사용해야 한다.

Dependencies upgrade

스프링 배치 5는 전반적으로 스프링 의존성을 다음 버전으로 업데이트한다:

  • 스프링 프레임워크 6
  • 스프링 인테그레이션 6
  • 스프링 데이터 3
  • 스프링 AMQP 3
  • 스프링 for 아파치 카프카 3
  • 마이크로미터 1.10

또한, 이 버전의 마그레이션 표시:

  • 자카르타(Jakarta) EE 9: 사용하는 모든 EE API에 대해 import 문을 javax.에서 jakarta.로 업데이트 해야한다.
  • 하이버네이트(Hibernate) 6: 하이버네이트(커서: cursor/페이징: paging) 아이템 리더(reader) 및 라이터(writer)가 하이버네이트 6.1 API(이전에는 하이버네이트 5.6 API 사용)를 사용하도록 업데이트됐다.

추가적으로:

  • org.springframework:spring-jdbc는 이제 spring-batch-core의 필수 의존성이다.
  • junit:junit는 더 이상 spring-batch-test에서 필수 의존성이 아니다.
  • com.fasterxml.jackson.core:jackson-core는 이제 spring-batch-core에서 선택사항이다.

Database schema updates

오라클(Oracle)

이 버전에서는, 이제 오라클 시퀀스(sequences)가 ​​사용된다. 시퀀스 생성 스크립트가 새 애플리케이션에 맞게 업데이트됐다. 기존 애플리케이션은 org/springframework/batch/core/migration/5.0/migration-oracle.sql의 마이그레이션 스크립트를 사용하여 기존 시퀀스를 변경할 수 있다.

또한, 오라클용 DDL 스크립트명이 다음과 같이 변경됐다:

  • org/springframework/batch/core/schema-drop-oracle10g.sql의 이름이 org/springframework/batch/core/schema-drop-oracle.sql로 변경됐다.
  • org/springframework/batch/core/schema-oracle10g.sql의 이름이 org/springframework/batch/core/schema-oracle.sql로 변경됐다.

MS SQLServer

v4까지, MS SQLServer용 DDL 스크립트가 테이블을 사용하여 시퀀스(sequence)를 에뮬레이트했다. 이 버전에서 이 사용법은 실제 시퀀스로 업데이트됐다:

CREATE SEQUENCE BATCH_STEP_EXECUTION_SEQ START WITH 0 MINVALUE 0 MAXVALUE 9223372036854775807 NO CACHE NO CYCLE;
CREATE SEQUENCE BATCH_JOB_EXECUTION_SEQ START WITH 0 MINVALUE 0 MAXVALUE 9223372036854775807 NO CACHE NO CYCLE;
CREATE SEQUENCE BATCH_JOB_SEQ START WITH 0 MINVALUE 0 MAXVALUE 9223372036854775807 NO CACHE NO CYCLE;

새 애플리케이션은 수정 없이 제공된 스크립트를 사용할 수 있다. 기존 애플리케이션은 v4와 함께 사용되는 시퀀스 테이블의 마지막 값에서 시퀀스를 시작하도록 위의 스니펫을 수정하는 것을 고려해야 한다.

All platforms

Removal of BATCH_JOB_EXECUTION#JOB_CONFIGURATION_LOCATION column

BATCH_JOB_EXECUTION 테이블의 JOB_CONFIGURATION_LOCATION 컬럼은 더 이상 사용되지 않으며 필요한 경우 미사용으로 표시하거나 삭제할 수 있다:

ALTER TABLE BATCH_JOB_EXECUTION DROP COLUMN JOB_CONFIGURATION_LOCATION;

컬럼 삭제 문법은 데이터베이스 서버의 버전에 따라 다를 수 있으므로, 컬럼 삭제 문법을 확인해보자. 이 변경으로 인해 일부 플랫폼에서는 테이블 재구성이 필요할 수 있다.

❗ 중요 노트 ❗ 변경점은 주로 이 컬럼을 사용하는 프레임워크의 유일한 부분인 JSR-352 구현의 제거와 관련이 있다. 결과적으로, JobExecution#jobConfigurationName 필드와 이를 사용하는 모든 API(도메인 객체 잡익스큐션(JobExecution)의 생성자 및 getter, 잡리포지터리(JobRepository)JobRepository#createJobExecution(JobInstance, JobParameters, String) 메서드)가 제거됐다.

Column change in BATCH_JOB_EXECUTION_PARAMS

BATCH_JOB_EXECUTION_PARAMS가 다음과 같이 업데이트됐다:

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,
+++ PARAMETER_NAME VARCHAR(100) NOT NULL,
+++ PARAMETER_TYPE VARCHAR(100) NOT NULL,
+++ PARAMETER_VALUE VARCHAR(2500),
IDENTIFYING CHAR(1) NOT NULL,
constraint JOB_EXEC_PARAMS_FK foreign key
(JOB_EXECUTION_ID)
references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
);

이는 https://github.com/spring-projects/spring-batch/issues/3960에서 재검토된 잡 파라미터가 유지되는 방식과 관련이 있다. 마이그레이션 스크립트는 org/springframework/batch/core/migration/5.0에서 찾을 수 있다.

Column change in BATCH_STEP_EXECUTION

새 컬럼 CREATE_TIME이 v5에 추가됐다. 다음과 같이 데이터베이스 서버에 따라 테이블에 생성해야 한다.

  ALTER TABLE BATCH_STEP_EXECUTION ADD CREATE_TIME TIMESTAMP NOT NULL DEFAULT '1970-01-01 00:00:00';

또한, NOT NULL 제약 조건이 START_TIME 컬럼에서 삭제됐다:

  ALTER TABLE BATCH_STEP_EXECUTION ALTER COLUMN START_TIME DROP NOT NULL;

Infrastructure beans configuration with @EnableBatchProcessing

Job repository/explorer configuration updates

맵(Map) 기반 잡 리포지터리/익스플로러 구현체는 v4에서 더 이상 사용되지 않으며 v5에서 완전히 제거됐다. 대신 Jdbc 기반 구현체을 사용해야 한다. 커스텀 잡 리포지터리/익스플로러 구현체를 사용하지 않는 한, @EnableBatchProcessing 어노테이션은 애플리케이션 컨텍스트에서 데이터소스 빈(DataSource bean)이 필요한 Jdbc 기반 잡리포지터리(JobRepository)를 구성한다. 데이터소스(DataSource) 빈은 인메모리(in-memory) 잡 리포지터리와 함께 작동하기 위해 H2, HSQL 등과 같은 내장 데이터베이스를 참조할 수 있다.

Transaction manager bean exposure/configuration

버전 4.3까지, @EnableBatchProcessing 어노테이션은 애플리케이션 컨텍스트에서 트랜잭션 매니저 빈(tranasaction manager bean)을 노출했다. 이 릴리스에서 @EnableBatchProcessing은 더 이상 애플리케이션 컨텍스트에서 트랜잭션 매니저 빈을 노출하지 않는다. 이 변경 사항은 https://github.com/spring-projects/spring-batch/issues/816 문제와 관련이 있다.

앞서 언급한 문제의 결과와 https://github.com/spring-projects/spring-batch/issues/4130에서 수정된 트랜잭션 매니저에 관한 XML 및 자바 구성 스타일 간의 불일치와 함께 이제 tasklet 스텝 정의에서 트랜잭션 매니저를 수동으로 구성해야 한다. StepBuilderHelper#transactionManager(PlatformTransactionManager) 메서드가 앱스트랙트태스크릿스텝빌더(AbstractTaskletStepBuilder)로 한 레벨 아래로 이동됐다.

이와 관련하여 v4에서 v5로의 일반적인 마이그레이션 경로는 다음과 같다:

  // v4 샘플
  @Configuration
  @EnableBatchProcessing
  public class MyStepConfig {
      @Autowired
      private StepBuilderFactory stepBuilderFactory;

      @Bean
      public Step myStep() {
        return this.stepBuilderFactory.get("myStep")
                .tasklet(..) // or .chunk()
                .build();
      }
  }
  // v5 샘플
  @Configuration
  @EnableBatchProcessing
  public class MyStepConfig {

      @Bean
      public Tasklet myTasklet() {
        return new MyTasklet();
      }

      @Bean
      public Step myStep(JobRepository jobRepository, Tasklet myTasklet, PlatformTransactionManager transactionManager) {
        return new StepBuilder("myStep", jobRepository)
                .tasklet(myTasklet, transactionManager) // or .chunk(chunkSize, transactionManager)
                .build();
      }
  }

이는 tasklet 스텝에만 필요하며, 다른 스텝 타입에는 설계상 트랜잭션 매니저가 필요하지 않다.

또한, 트랜잭션 매니저는 BatchConfigurer#getTransactionManager를 구현할 수 있다. 트랜잭션 매니저는 잡리포지터리(JobRepository) 구현의 세부 사항이므로. 잡리포지터리(JobRepository)와 동일한 레벨(즉, 동일한 인터페이스에서)에서 구성하면 안된다. 이 릴리스에서는 배치컨피규어러(BatchConfigurer) 인터페이스가 제거됐다. 필요한 경우, 커스텀 트랜잭션 매니저는 @EnableBatchProcessing의 애트리뷰트로 선언하여 제공하거나, DefaultBatchConfiguration#getTransactionManager()를 오버라이드(override)하여 제공될 수 있다. 이 변경 사항에 대한 자세한 내용은 https://github.com/spring-projects/spring-batch/issues/3942를 확인하자.

JobBuilderFactory and StepBuilderFactory bean exposure/configuration

잡빌더팩토리(JobBuilderFactory)스텝빌더팩토리(StepBuilderFactory)는 더 이상 애플리케이션 컨텍스트에서 빈으로 노출되지 않으며, v5.2에서 더 이상 사용되지 않고 이들을 생성하는 각각의 빌더를 사용하기 위해 제거된다.

이와 관련하여 v4에서 v5로의 마이그레이션 방법은 다음과 같다:

  // v4 샘플
  @Configuration
  @EnableBatchProcessing
  public class MyJobConfig {

      @Autowired
      private JobBuilderFactory jobBuilderFactory;

      @Bean
      public Job myJob(Step step) {
        return this.jobBuilderFactory.get("myJob")
                .start(step)
                .build();
      }
  }
  // v5 샘플
  @Configuration
  @EnableBatchProcessing
  public class MyJobConfig {

      @Bean
      public Job myJob(JobRepository jobRepository, Step step) {
        return new JobBuilder("myJob", jobRepository)
                .start(step)
                .build();
      }
  }

더 이상 사용되지 않는 스텝빌더팩토리(StepBuilderFactory)의 사용을 제거하는 데 동일한 패턴을 사용할 수 있다. 이 변경 사항에 대한 자세한 내용은 https://github.com/spring-projects/spring-batch/issues/4188을 확인하세요.

Data types updates

  • org.springframework.batch.core.StepExecutionorg.springframework.batch.core.StepContribution의 메트릭 카운터(Metric counter)(readCount, writeCount 등)가 int에서 long으로 변경됐다. 그에 따라 모든 getter 및 setter가 업데이트됐다.
  • org.springframework.batch.core.step.skip.SkipPolicy#shouldSkipskipCount 파라미터가 int에서 long으로 변경됐다. 이것은 이전 항목과 관련이 있다.
  • 잡익스큐션(JobExecution)스텝익스큐션(StepExecution)의 필드 startTime, endTime, createTimelastUpdated 타입이 java.util.Date에서 java.time.LocalDateTime으로 변경됐다.

Observability updates

  • 마이크로미터가 버전 1.10으로 업데이트됐다.
  • 이제 모든 태그에 meter명이 접두사로 붙는다. 예를 들어 타이머 spring.batch.job의 태그는 버전 4.x에서 이름과 상태로 지정됐다. 버전 5에서 태그명은 이제 각각 spring.batch.job.namespring.batch.job.status로 지정된다.
  • 배치매트릭(BatchMetrics) 클래스(내부 전용)는 org.springframework.batch.core.metrics에서 org.springframework.batch.core.observability 패키지로 이동됐다.

Execution context serialization updates

Starting from v5, the default ExecutionContextSerializer was changed from JacksonExecutionContextStringSerializer to DefaultExecutionContextSerializer. The default execution context serializer was updated to serialize/deserialize the context to/from Base64.

The dependency to Jackson was made optional. In order to use the JacksonExecutionContextStringSerializer, jackson-core should be added to the classpath.

SystemCommandTasklet updates

시스템커멘드태스크릿(SystemCommandTasklet)은 이 릴리스에서 재검토되었으며 다음과 같이 변경됐다:

  • 태스크릿 익스큐션(tasklet execution)에서 실행 명령을 분리하기 위해 커맨드러너(CommandRunner)라는 새로운 전략 인터페이스가 도입됐다. 기본 구현은 java.lang.Runtime#exec API를 사용하여 시스템 명령을 실행하는 Jvm커멘트러너(JvmCommandRunner)이다. 이 인터페이스는 다른 API를 사용하여 시스템 명령을 실행하도록 구현할 수 있다.
  • 명령을 실행하는 메서드는 이제 명령(command)과 해당 아규먼트를 나타내는 스트링(String) 배열을 허용한다. 더 이상 명령을 토큰화하거나 전처리를 수행할 필요가 없다. 이 변경으로 인해 API가 더 직관적이고 오류가 덜 발생한다.

Job parameters handling updates

Support for any type as a job parameter

이번 변경으로 v4에서와 같이 사전 정의된 4가지 타입(long, double, string, date)뿐만, 아니라 모든 타입을 잡 파라미터로 사용할 수 있도록 추가됐다. 주요 변경 사항은 다음과 같다:

—public class JobParameter implements Serializable {
+++public class JobParameter implements Serializable { </span>
--- private Object parameter;
+++ private T value;
--- private ParameterType parameterType;
+++ private Class type; </span>
}

이 버전에서, 잡파라미터(JobParameter)는 모든 타입이 될 수 있다. 이 변경으로 인해 getType()의 반환 타입 변경 또는 파라미터타입(ParameterType) 이넘(enum) 제거와 같은 많은 API 변경이 필요했다. 이 업데이트와 관련된 모든 변경 사항은 “[DeprecatedMovedRemoved] APIs” 절에서 찾을 수 있다.

이 변경 사항은 잡 파라미터가 데이터베이스에 지속되는 방식(미리 정의된 각 타입에 대해 더 이상 4개의 개별 컬럼이 없음)에 영향을 미쳤다. DDL 변경에 대한 BATCH_JOB_EXECUTION_PARAMS의 컬럼 변경을 확인하자. 이제 파라미터 타입의 정규화된 이름과 파라미터 값이 문자열로 유지된다. 스트링(String) 리터럴은 표준 스트링 컨버전(conversion) 서비스를 사용하여 파라미터 타입으로 변환된다. 표준 컨버전(conversion) 서비스는 특정 타입을 스트링(String) 리터럴로 변환하거나 스트링(String) 리터럴에서 변환하는 데 필요한 컨버터(converter)로 보강할 수 있다.

Default job parameter conversion

v4에서 잡 파라미터의 기본 표기법은 다음과 같이 지정됐다:

  [+|-]parameterName(parameterType)=value

여기서 파라미터타입(parameterType)은 [string,long,double,date] 중 하나이다. 제한적인 것 외에도, 이 표기법은 https://github.com/spring-projects/spring-batch/issues/3960에 설명된 것처럼 여러 문제를 일으켰다.

v5에서는, 잡 파라미터를 지정하는 두 가지 방법이 있다:

Default notation

기본 표기법은 다음과 같이 지정된다:

  parameterName=parameterValue,parameterType,identificationFlag

여기서 파라미터타입(parameterType)은 파라미터 타입명이다. 스프링 배치는 이 표기법을 지원하기 위해 디폴트잡파라미터컨버터(DefaultJobParametersConverter)를 제공한다.

Extended notation

기본 표기법은 대부분의 사용 사례에 적합하지만, 예를 들어 값에 쉼표(,)가 포함되어 있으면 불편할 수 있다. 이 경우 스프링 부트의 Json Application Properties에서 영감을 받아 다음과 같이 확장 표기법을 사용할 수 있다:

parameterName='{"value": "parameterValue", "type":"parameterType", "identifying": "booleanValue"}'

여기서 파라미터타입(parameterType)은 파라미터 타입명이다. 스프링 배치는 이 표기법을 지원하기 위해 Json잡파라미터컨버터(JsonJobParametersConverter)를 제공한다.

Historical data access implications

잡 파라미터 처리에 대한 이러한 주요 변경 사항으로 인해, 배치 메타데이터를 탐색하도록 설계된 일부 API는 v4로 시작된 잡 인스턴스에 사용하면 안 된다. 예를들어:

  • JobExplorer#getJobInstances는 v4와 v5 사이에 기록된 데이터를 혼합해 검색할 수 있으며 v4의 잡 파라미터 로드에 실패할 수 있다(#4352). 이 특별한 경우 v5로 실행된 첫 번째 인스턴스의 인덱스에서 시작해야 한다.
  • 전달된 잡 실행 ID가 v4로 실행된 실행 중 하나인 경우, JobExplorer#getJobExecution이 잡 파라이터 검색에 실패할 수 있다.

이 변경 사항이 잡 파라미터 로드에 영향을 미치는 또 다른 경우는 실패한 잡 인스턴스를 재시작하는 경우이다. v5로의 마이그레이션이 완료되기 전에 실패한 모든 v4 잡 인스턴스가 성공적으로 재시작되거나 중단될 것으로 예상된다.

Deprecated APIs

The following APIs have been deprecated in version 5.0:

  • org.springframework.batch.core.listener.ChunkListenerSupport
  • org.springframework.batch.core.listener.StepExecutionListenerSupport
  • org.springframework.batch.repeat.listener.RepeatListenerSupport
  • org.springframework.batch.core.listener.JobExecutionListenerSupport
  • org.springframework.batch.core.listener.SkipListenerSupport
  • org.springframework.batch.item.data.Neo4jItemReader
  • org.springframework.batch.item.data.builder.Neo4jItemWriterBuilder
  • org.springframework.batch.item.data.Neo4jItemWriter
  • org.springframework.batch.item.data.builder.Neo4jItemWriterBuilder
  • org.springframework.batch.item.database.support.SqlPagingQueryUtils#generateLimitGroupedSqlQuery(org.springframework.batch.item.database.support.AbstractSqlPagingQueryProvider, boolean, java.lang.String)
  • org.springframework.batch.core.repository.dao.JdbcJobInstanceDao#setJobIncrementer(DataFieldMaxValueIncrementer jobIncrementer)
  • org.springframework.batch.core.launch.support.SimpleJobLauncher
  • org.springframework.batch.core.configuration.annotation.JobBuilderFactory
  • org.springframework.batch.core.configuration.annotation.StepBuilderFactory
  • 생성자 org.springframework.batch.core.job.builder.JobBuilder#JobBuilder(java.lang.String)
  • 생성자 org.springframework.batch.core.step.builder.StepBuilder#StepBuilder(java.lang.String)
  • 메서드 org.springframework.batch.core.step.builder.StepBuilder#tasklet(org.springframework.batch.core.step.tasklet.Tasklet)
  • 메서드 org.springframework.batch.core.step.builder.StepBuilder#chunk(int)
  • 메서드 org.springframework.batch.core.step.builder.StepBuilder#chunk(org.springframework.batch.repeat.CompletionPolicy)
  • 메서드 org.springframework.batch.core.step.builder.TaskletStepBuilder#tasklet(org.springframework.batch.core.step.tasklet.Tasklet)
  • 생성자 org.springframework.batch.integration.chunk.RemoteChunkingManagerStepBuilder#RemoteChunkingManagerStepBuilder(java.lang.String)
  • 생성자 org.springframework.batch.integration.partition.RemotePartitioningManagerStepBuilder#RemotePartitioningManagerStepBuilder(java.lang.String)
  • 생성자 org.springframework.batch.integration.partition.RemotePartitioningWorkerStepBuilder#RemotePartitioningWorkerStepBuilder(java.lang.String)
  • 메서드 org.springframework.batch.integration.partition.RemotePartitioningWorkerStepBuilder#tasklet(org.springframework.batch.core.step.tasklet.Tasklet)
  • 메서드 org.springframework.batch.integration.partition.RemotePartitioningWorkerStepBuilder#chunk(int)
  • 메서드 org.springframework.batch.integration.partition.RemotePartitioningWorkerStepBuilder#chunk(org.springframework.batch.repeat.CompletionPolicy)
  • 메서드 org.springframework.batch.core.JobParameters#toProperties
  • 메서드 org.springframework.batch.core.JobParametersBuilder#addParameter
  • 클래스 org.springframework.batch.core.launch.support.JobRegistryBackgroundJobRunner
  • 클래스 org.springframework.batch.test.DataSourceInitializer
  • 클래스 org.springframework.batch.integration.step.DelegateStep
  • 어노테이션 org.springframework.batch.support.annotation.Classifier
  • 클래스 org.springframework.batch.item.ItemStreamSupport
  • 메서드 org.springframework.batch.core.step.builder.AbstractTaskletStepBuilder#throttleLimit
  • 메서드 org.springframework.batch.repeat.support.TaskExecutorRepeatTemplate#setThrottleLimit
  • 인터페이스 org.springframework.batch.repeat.support.ResultHolder
  • 인터페이스 org.springframework.batch.repeat.support.ResultQueue
  • 클래스 org.springframework.batch.repeat.support.ResultHolderResultQueue
  • 클래스 org.springframework.batch.repeat.support.ThrottleLimitResultQueue

교체 제안에 대한 자세한 내용은 각 API의 자바독(javadoc)을 참고하자.

Moved APIs

  • 배치매트릭스(BatchMetrics) 클래스(내부 전용)는 org.springframework.batch.core.metrics에서 org.springframework.batch.core.observability 패키지로 이동됐다.
  • 청크(Chunk) 클래스가 org.springframework.batch.core.step.item 패키지(spring-batch-core 모듈)에서 org.springframework.batch.item 패키지(spring-batch-infrastrucutre 모듈)로 이동됐다.
  • 스코프컨피규레이션(ScopeConfiguration) 클래스는 org.springframework.batch.core.configuration.annotation에서 org.springframework.batch.core.configuration.support로 이동했다.

Removed APIs

The following APIs were deprecated in previous versions and have been removed in this release:

  • 클래스 org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean
  • 클래스 org.springframework.batch.core.repository.dao.MapExecutionContextDao
  • 클래스 org.springframework.batch.core.repository.dao.MapJobExecutionDao
  • 클래스 org.springframework.batch.core.repository.dao.MapJobInstanceDao
  • 클래스 org.springframework.batch.core.repository.dao.MapStepExecutionDao
  • 클래스 org.springframework.batch.core.explore.support.MapJobExplorerFactoryBean
  • 클래스 org.springframework.batch.core.repository.dao.XStreamExecutionContextStringSerializer
  • 클래스 org.springframework.batch.core.configuration.support.ClassPathXmlJobRegistry
  • 클래스 org.springframework.batch.core.configuration.support.ClassPathXmlApplicationContextFactory
  • 클래스 org.springframework.batch.core.launch.support.ScheduledJobParametersFactory
  • 클래스 org.springframework.batch.item.data.AbstractNeo4jItemReader
  • 클래스 org.springframework.batch.item.database.support.ListPreparedStatementSetter
  • 클래스 org.springframework.batch.integration.chunk.RemoteChunkingMasterStepBuilder
  • 클래스 org.springframework.batch.integration.chunk.RemoteChunkingMasterStepBuilderFactory
  • 클래스 org.springframework.batch.integration.partition.RemotePartitioningMasterStepBuilder
  • 클래스 org.springframework.batch.integration.partition.RemotePartitioningMasterStepBuilderFactory
  • 클래스 org.springframework.batch.test.AbstractJobTests
  • 클래스 org.springframework.batch.item.xml.StaxUtils
  • 이넘(Enum) org.springframework.batch.item.file.transform.Alignment
  • 이넘(Enum) org.springframework.batch.core.JobParameter#ParameterType
  • 메서드 org.springframework.batch.core.JobExecution#stop()
  • 메서드 org.springframework.batch.core.JobParameters#getDouble(String key, double defaultValue)
  • 메서드 org.springframework.batch.core.JobParameters#getLong(String key, long defaultValue)
  • 메서드 org.springframework.batch.core.partition.support.SimpleStepExecutionSplitter(JobRepository jobRepository, Step step, Partitioner partitioner)
  • 메서드 org.springframework.batch.core.partition.support.SimpleStepExecutionSplitter#getStartable(StepExecution stepExecution, ExecutionContext context)
  • 메서드 org.springframework.batch.core.repository.support.AbstractJobRepositoryFactoryBean#getJobRepository()
  • 메서드 org.springframework.batch.item.database.AbstractCursorItemReader#cleanupOnClose()
  • 메서드 org.springframework.batch.item.database.HibernateItemWriter#doWrite(HibernateOperations hibernateTemplate, List<? extends T> items)
  • 메서드 org.springframework.batch.item.database.JdbcCursorItemReader#cleanupOnClose()
  • 메서드 org.springframework.batch.item.database.StoredProcedureItemReader#cleanupOnClose()
  • 메서드 org.springframework.batch.item.database.builder.HibernatePagingItemReaderBuilder#useSatelessSession(boolean useStatelessSession)
  • 메서드 org.springframework.batch.item.file.MultiResourceItemReader#getCurrentResource()
  • 메서드 org.springframework.batch.integration.config.annotation.BatchIntegrationConfiguration#remoteChunkingMasterStepBuilderFactory()
  • 메서드 org.springframework.batch.integration.config.annotation.BatchIntegrationConfiguration#remotePartitioningMasterStepBuilderFactory()
  • 메서드 org.springframework.batch.item.util.FileUtils#setUpOutputFile(File file, boolean restarted, boolean overwriteOutputFile)

또한, 다음 API는 디프리케이션(deprecation) 없이 제거/업데이트됐다:

  • 인터페이스 org.springframework.batch.core.configuration.annotation.BatchConfigurer는 제거됐다. https://github.com/spring-projects/spring-batch/issues/3942를 참고하자.
  • 클레스 org.springframework.batch.core.configuration.annotation.DefaultBatchConfigurer는 제거됐다. https://github.com/spring-projects/spring-batch/issues/3942를 참고하자.
  • 메서드 org.springframework.batch.core.step.builder.SimpleStepBuilder#processor 람다가 아이템 프로세서로 전달될 수 있도록 제거됐다. 이 근거에 대한 자세한 사항은 https://github.com/spring-projects/spring-batch/issues/4061을 참조하자.SimpleStepBuilder::processor의 아규먼트로 실제 함수를 사용하는 경우, .processor(function::apply)로 변경하여 v5로 마이그레이션할 수 있다.
  • org.springframework.batch.item.file.builder.FlatFileItemWriterBuilder#resource, org.springframework.batch.item.file.ResourceAwareItemWriterItemStream#setResource, org.springframework.batch.item.json.builder.JsonFileItemWriterBuilder#resource, org.springframework.batch.item.json.JsonFileItemWriter#JsonFileItemWriter, org.springframework.batch.item.support.AbstractFileItemWriter#setResource, org.springframework.batch.item.xml.builder.StaxEventItemWriterBuilder#resource 그리고 org.springframework.batch.item.xml.StaxEventItemWriter#setResourceorg.springframework.core.io.Resource 대신 org.springframework.core.io.WritableResource를 사용하도록 업데이트됐다. 이 변경 사항에 대한 자세한 내용은 https://github.com/spring-projects/spring-batch/issues/756을 참고하자.

  • 정적 타입(static type) org.springframework.batch.item.data.builder.RepositoryItemReaderBuilder.RepositoryMethodReference 메서드와 함께 org.springframework.batch.item.data.builder.RepositoryItemReaderBuilder#repository(RepositoryMethodReference<?>) 메서드가 제거됐다.
  • ItemWriter#write(List) 메서드가 ItemWriter#write(Chunk)로 변경됐다.
  • 리스트(List) 대신 청크(Chunk) API를 사용하도록 아이템라이터(ItemWriter)의 모든 구현체가 업데이트됐다.
  • 리스트(List) 대신 청크(Chunk) API를 사용하도록 아이템라이터리스너(ItemWriteListener) 인터페이스의 모든 메서드가 업데이트됐다.
  • 리스트(List) 대신 청크(Chunk) API를 사용하도록 아이템라이터리스터(ItemWriteListener)의 모든 구현체가 업데이트됐다.
  • 청크리퀘스트(ChunkRequest) 생성자(constructor)가 아이템 컬렉션(Collection) 대신 청크를 사용하도록 변경됐다.
  • ChunkRequest#getItems()의 반환 유형이 리스트(List) 대신 청크(Chunk)로 변경됐다.
  • 잡리포지터리테스트유틸(JobRepositoryTestUtils)은 데이터 소스 빈에 의존하지 않고, 잡리포지터리(JobRepository) 인터페이스에 대해 작동하도록 변경됐다. 이 변경으로 인해 데이터소스(DataSource)를 파라미터로 사용하는 생성자(JobRepositoryTestUtils(JobRepository jobRepository, DataSource dataSource))와 퍼블릭(public) 데이터 소스 세터(DataSource setter)가 제거됐다. 이것은 문제 #4070과 관련이 있다.
  • 메서드 StepBuilderHelper#transactionManager(PlatformTransactionManager)AbstractTaskletStepBuilder로 이동됐다. 이것은 https://github.com/spring-projects/spring-batch/issues/4130 문제와 관련이 있다.
  • 메서드 RemotePartitioningManagerStepBuilder#transactionManager(PlatformTransactionManager)RemotePartitioningWorkerStepBuilder#transactionManager(PlatformTransactionManager)가 제거됐다. 이러한 타입의 스텝에는 트랜잭션 매니저가 필요하지 않다. 이것은 https://github.com/spring-projects/spring-batch/issues/4130 문제와 관련이 있다.
  • 메서드 JobParameter#getType은 이제 오브젝트(Object) 대신 T를 반환한다.
  • 4개의 사전 정의된 잡 파라미터 타입(date, string, long, double)을 사용하는 잡파라미터(JobParameter)의 생성자가 제거됐다.
  • 생성자 SkipWrapper(Throwable e)가 제거됐다.
  • 앱스트랙트잡리포지터리팩토리빈(AbstractJobRepositoryFactoryBean)의 세터(setter) setIsolationLevelForCreate(Isolation) 명이 setIsolationLevelForCreateEnum으로 변경됐다.
  • JobExplorer#getJobInstanceCountJobInstanceDao#getJobInstanceCount의 반환 타입이 int에서 long으로 변경됐다.
  • JobRepository#getStepExecutionCountStepExecutionDao#countStepExecutions의 반환 유형이 int에서 long으로 변경됐다.

Pruning

SQLFire support removal

SqlFire는 2014년 11월 1일부로 EOL로 발표됐다. 잡 리포지터리로서 SQLFire 지원은 버전 4.3에서 디프리케이티드 됐으며 버전 5.0에서 제거됐다.

JSR-352 implementation removal

관심 부족으로 인해 JSR-352의 구현은 이 릴리스에서 중단됐다.

Gemfire support removal

아파치 Geode용 스프링 데이터 지원 중단 결정에 따라, 스프링 배치에서 Geode 지원이 제거됐다. 코드는 커뮤니티의 노력으로 spring-batch-extensions 저장소로 이동됐다.