Skip to content

Introduce a new scrolling-based ItemReader #4484

Open
@scordio

Description

@scordio

Spring Data Commons 3.1 introduced the concept of scrolling (spring-projects/spring-data-commons#2787) and I'm particularly interested in scrolling using keyset-filtering, which provides performance benefits with large datasets.

It would be nice to have an item reader compatible with this concept.

As far as I can judge, RepositoryItemReader is highly coupled with PagingAndSortingRepository, therefore an extension doesn't seem to be the right direction as scrolling is supposed to work with any Repository.

Therefore, my proposal would be to introduce a new ItemReader, maybe a ScrollingRepositoryItemReader?

Happy to work on a PR in case the idea is accepted.

My concrete use case: in several Batch & JPA-based projects that are still on Spring Boot 2.7, scrolling based on keyset-filtering is currently achieved via a custom AbstractPaginatedItemReader with an underlying Spring Data JPA repository using QueryDSL predicates. After upgrading to Spring Boot 3, the QueryDSL predicates will be replaced by the Spring Data scrolling API. I would also be very happy to throw away the custom item reader if Spring Batch offered an idiomatic way to achieve the same result.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions