Closed hpoettker closed 1 year ago
Thank you for pointing this. That's correct, only the methods open
, close
and update
should deprecated, not the entire class. This will be fixed for 5.0 GA.
Thank you for pointing this. That's correct, only the methods
open
,close
andupdate
should deprecated, not the entire class. This will be fixed for 5.0 GA.
Should these methods really be deprecated? I cannot implement open/close/update in a class that extends from ItemStreamSupport, without getting deprecation warnings.
I cannot implement open/close/update in a class that extends from ItemStreamSupport, without getting deprecation warnings.
You should be able to do that. Here is a quick example:
class MyItemStreamSupport extends ItemStreamSupport {
@Override
public void open(ExecutionContext executionContext) throws ItemStreamException {
super.open(executionContext);
}
@Override
public void update(ExecutionContext executionContext) throws ItemStreamException {
super.update(executionContext);
}
@Override
public void close() throws ItemStreamException {
super.close();
}
}
I have no warnings here. Is this what you are referring to, @jpraet ?
I get these warnings in IntelliJ as well as during maven compilation:
[WARNING] D:\projects\batch-framework\batch-core\src\main\java\be\fgov\kszbcss\batch\core\MyItemStreamSupport.java:[10,16] [removal] open(ExecutionContext) in ItemStreamSupport has been deprecated and marked for removal
[WARNING] D:\projects\batch-framework\batch-core\src\main\java\be\fgov\kszbcss\batch\core\MyItemStreamSupport.java:[11,13] [removal] open(ExecutionContext) in ItemStreamSupport has been deprecated and marked for removal
[WARNING] D:\projects\batch-framework\batch-core\src\main\java\be\fgov\kszbcss\batch\core\MyItemStreamSupport.java:[15,16] [removal] update(ExecutionContext) in ItemStreamSupport has been deprecated and marked for removal
[WARNING] D:\projects\batch-framework\batch-core\src\main\java\be\fgov\kszbcss\batch\core\MyItemStreamSupport.java:[16,13] [removal] update(ExecutionContext) in ItemStreamSupport has been deprecated and marked for removal
[WARNING] D:\projects\batch-framework\batch-core\src\main\java\be\fgov\kszbcss\batch\core\MyItemStreamSupport.java:[20,16] [removal] close() in ItemStreamSupport has been deprecated and marked for removal
[WARNING] D:\projects\batch-framework\batch-core\src\main\java\be\fgov\kszbcss\batch\core\MyItemStreamSupport.java:[21,13] [removal] close() in ItemStreamSupport has been deprecated and marked for removal
Which revision of Spring Batch do you have? It seems you are compiling a version that contains those methods in ItemStreamSupport
. Those methods have been removed as they are now present as default methods in the ItemStream
interface.
Which profile do you have in IntelliJ Idea? I also use IntelliJ Idea and I have no warnings.
Moreover, are you using the maven wrapper to compile the infrastructure module? Here is what I have when I add that class and compile on the CLI:
spring-batch-infrastructure % ../mvnw compile
[INFO] Scanning for projects...
[INFO]
[INFO] -------< org.springframework.batch:spring-batch-infrastructure >--------
[INFO] Building Spring Batch Infrastructure 5.2.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- spring-javaformat-maven-plugin:0.0.39:validate (default) @ spring-batch-infrastructure ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ spring-batch-infrastructure ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/resources
[INFO]
[INFO] --- flatten-maven-plugin:1.6.0:flatten (flatten) @ spring-batch-infrastructure ---
[INFO] Generating flattened POM of project org.springframework.batch:spring-batch-infrastructure:jar:5.2.0-SNAPSHOT...
[INFO]
[INFO] --- maven-compiler-plugin:3.13.0:compile (default-compile) @ spring-batch-infrastructure ---
[INFO] Recompiling the module because of changed source code.
[INFO] Compiling 360 source files with javac [debug release 17] to target/classes
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/MongoPagingItemReader.java:[70,47] org.springframework.batch.item.data.MongoItemReader in org.springframework.batch.item.data has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/MongoPagingItemReader.java:[70,47] org.springframework.batch.item.data.MongoItemReader in org.springframework.batch.item.data has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/builder/MongoItemReaderBuilder.java:[267,16] org.springframework.batch.item.data.MongoItemReader in org.springframework.batch.item.data has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/builder/MongoItemReaderBuilder.java:[279,17] org.springframework.batch.item.data.MongoItemReader in org.springframework.batch.item.data has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/builder/MongoItemReaderBuilder.java:[279,49] org.springframework.batch.item.data.MongoItemReader in org.springframework.batch.item.data has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/builder/MongoPagingItemReaderBuilder.java:[39,54] org.springframework.batch.item.data.builder.MongoItemReaderBuilder in org.springframework.batch.item.data.builder has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/builder/MongoPagingItemReaderBuilder.java:[39,54] org.springframework.batch.item.data.builder.MongoItemReaderBuilder in org.springframework.batch.item.data.builder has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultHolderResultQueue.java:[36,49] org.springframework.batch.repeat.support.ResultQueue in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultHolderResultQueue.java:[36,49] org.springframework.batch.repeat.support.ResultQueue in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultHolderResultQueue.java:[36,61] org.springframework.batch.repeat.support.ResultHolder in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultHolderResultQueue.java:[39,37] org.springframework.batch.repeat.support.ResultHolder in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultHolderResultQueue.java:[86,25] org.springframework.batch.repeat.support.ResultHolder in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultHolderResultQueue.java:[120,16] org.springframework.batch.repeat.support.ResultHolder in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultHolderResultQueue.java:[124,17] org.springframework.batch.repeat.support.ResultHolder in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultHolderResultQueue.java:[144,39] org.springframework.batch.repeat.support.ResultHolder in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultHolderResultQueue.java:[154,75] org.springframework.batch.repeat.support.ResultHolder in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultHolderResultQueue.java:[157,36] org.springframework.batch.repeat.support.ResultHolder in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultHolderResultQueue.java:[157,53] org.springframework.batch.repeat.support.ResultHolder in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplate.java:[105,17] org.springframework.batch.repeat.support.ResultQueue in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplate.java:[105,29] org.springframework.batch.repeat.support.ResultHolder in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplate.java:[143,17] org.springframework.batch.repeat.support.ResultHolder in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplate.java:[159,17] org.springframework.batch.repeat.support.ResultQueue in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplate.java:[159,29] org.springframework.batch.repeat.support.ResultHolder in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplate.java:[169,25] org.springframework.batch.repeat.support.ResultHolder in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplate.java:[207,62] org.springframework.batch.repeat.support.ResultHolder in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplate.java:[213,31] org.springframework.batch.repeat.support.ResultQueue in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplate.java:[213,43] org.springframework.batch.repeat.support.ResultHolder in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplate.java:[219,90] org.springframework.batch.repeat.support.ResultQueue in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplate.java:[219,102] org.springframework.batch.repeat.support.ResultHolder in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplate.java:[312,31] org.springframework.batch.repeat.support.ResultQueue in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplate.java:[312,43] org.springframework.batch.repeat.support.ResultHolder in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplate.java:[319,44] org.springframework.batch.repeat.support.ResultHolderResultQueue in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplate.java:[325,24] org.springframework.batch.repeat.support.ResultQueue in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplate.java:[325,36] org.springframework.batch.repeat.support.ResultHolder in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ThrottleLimitResultQueue.java:[33,53] org.springframework.batch.repeat.support.ResultQueue in org.springframework.batch.repeat.support has been deprecated and marked for removal
[WARNING] /Users/mbenhassine/projects/spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ThrottleLimitResultQueue.java:[33,53] org.springframework.batch.repeat.support.ResultQueue in org.springframework.batch.repeat.support has been deprecated and marked for removal
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.107 s
[INFO] Finished at: 2024-10-11T14:28:44+02:00
[INFO] ------------------------------------------------------------------------
spring-batch-infrastructure %
Apart from other deprecation warnings, I don't see any related to ItemStream
.
I would be grateful to get your feedback on this to fix things if any as I am working on releasing 5.2.0-M2.
I use the latest GA version 5.1.2. I think for 5.2.0 it should be alright as the deprecated methods have been removed.
OK now I see, it is because you are on 5.1.x. Indeed, these warnings are gone with 5.2.x.
Thank you for your quick feedback! Appreciated your time 🙇♂️
Starting with Spring Batch 5, the whole abstract class
ItemStreamSupport
is deprecated and marked for removal.For the methods
close
,open
, andupdate
, the default implementations ofItemStream
yield a one-to-one replacement, respectively.ItemStreamSupport
also has the methodssetName
,setExecutionContextName
, andgetExecutionContextKey
, for which no replacements exist as far as I can tell.Is there a replacement available for the latter methods? Or are only the methods that are inherited from
ItemStream
planned to be removed? If so, why not remove them without deprecation?