spring-projects / spring-projects/spring-batch

Get ItemReader reading a Stream, particularly RepositoryItemReader [BATCH-2681]

Open
#897 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: core related-to: item-readers-writers status: waiting-for-triage type: feature
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.