spring-batch icon indicating copy to clipboard operation
spring-batch copied to clipboard

Public access to AbstractItemCountingItemStreamItemReader.getCurrentItemCount [BATCH-1956]

Open spring-projects-issues opened this issue 12 years ago • 1 comments

Jimmy Praet opened BATCH-1956 and commented

Can the getCurrentItemCount() in AbstractItemCountingItemStreamItemReader be made public? Currently the setter is public, but the getter is protected.

Ideally it would be in a new ItemCountAwareItemStreamReader interface, that way the method can also be called on job-scoped instances with the default JDK proxies instead of cglib.

My current use case for this is creating a SkippableItemReader that is capable of skipping records based on a specific configuration table that stores the record numbers to skip per job instance. At the moment I had to create a SkippableFlatFileItemReader and SkippableStaxEventItemReader (with duplicated code). I would prefer creating a SkippableItemReader that can delegate to any AbstractItemCountingItemStreamItemReader / ItemCountAwareItemStreamReader.


No further details from BATCH-1956

spring-projects-issues avatar Feb 04 '13 04:02 spring-projects-issues

Michael Minella commented

For this type of functionality, we typically recommend using an ItemProcessor as a filter. Read in everything, and filter those items that are not to be updated out by returning null from the ItemProcessor.

spring-projects-issues avatar Feb 28 '13 13:02 spring-projects-issues