-
Notifications
You must be signed in to change notification settings - Fork 305
Spring Cloud Task 3.0 Migration Guide
This document is meant to help you migrate your application to Spring Cloud Task 3.0.
Spring Cloud Task 3 is based on Spring Framework 6 and Spring Boot 3 which requires Java 17 as a minimum version. Therefore, you need to use Java 17+ to run Spring Cloud Task 3 applications.
Spring Cloud Task 3 is updating its Spring dependencies across the board to the following versions:
- Spring Framework 6
- Spring Boot 3
Moreover, this version marks the migration to Jakarta EE 9. Please make sure to update your import statements from javax.*
to jakarta.*
for all EE APIs you use.
Up until v2, the DDL script for MS SQLServer used tables to emulate sequences. In this version, this usage has been updated with real sequences:
CREATE SEQUENCE TASK_SEQ START WITH 0 MINVALUE 0 MAXVALUE 9223372036854775807 NO CACHE NO CYCLE;
New applications can use the provided script with no modifications. Existing applications should consider modifying the snippet above to start sequences from the last value in sequence tables used with v4.
Oracle In this version, Oracle sequences are now ordered. The sequences creation script has been updated for new applications. Existing applications can use the migration script in org/springframework/batch/core/migration/5.0/migration-oracle.sql to alter the existing sequences.
Moreover, the DDL script for Oracle has been renamed as follows:
org/springframework/cloud/task/schema-oracle10g.sql
has been renamed to org/springframework/cloud/task/schema-oracle.sql
.
Due to updates in Spring Cloud Task 3.0:
-
Metric counters (
readCount
,writeCount
, etc) inorg.springframework.cloud.task.batch.listener.support.StepExecutionEvent
has been changed fromint
tolong
. All getters and setters have been updated accordingly. -
The type of fields
startTime
andendTime
in TaskExecution was changed fromjava.util.Date
tojava.time.LocalDateTime
.
If you have code that uses these fields you may have to update your code.
Micrometer has been updated to version 1.10
All tags are now prefixed with the meter name. For example, the tags of the timer spring.cloud.task
are named name and status in version 2.x. In version 3, those tags are now named spring.cloud.task.name
and spring.cloud.task.exit.code
respectively.
There have been several changes in Spring Batch and thus it is recommended that you also read the Spring Batch migration guide as many of these changes may affect users who use Spring Cloud Task plus Spring Batch.