spring-projects / spring-projects/spring-batch
Get ItemReader reading a Stream, particularly RepositoryItemReader [BATCH-2681]
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 2.5k
- Avg merge
- 6d 53m
- Merged PRs (30d)
- 3
Description
Philippe opened BATCH-2681 and commented
Today there is no reader component to be configured to read data from a Stream object.
It would be especially usefull that RepositoryItemReader could be configured to read data from a method whose return type is Stream<T> (today we get an exception if you try to do it, it seems to support only Page<T> types).
The reason is that with JPA those method use cursor, if the database support it, and so we can consequently get good performance results when batching treatment.
In the other case, we have to use the HibernateCursorItemReader, which is Hibernate specific because it require a SessionFactory, to read data with cursor.
No further details from BATCH-2681
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with RepositoryItemReader and its current handling of repository methods returning Page; reproduce the reported exception with a method returning Stream. Compare this with HibernateCursorItemReader and verify the result against the repository reader's existing behavior. Done means RepositoryItemReader can consume supported Stream-returning methods without the current exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 40/100