spring-projects / spring-projects/spring-batch
MultiResourceItemWriter creates an empty file if the number of item to write as itemCountLimitPerResource
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 2.5k
- Avg merge
- 6d 53m
- Merged PRs (30d)
- 3
Description
Hi,
I set the number of items to write as itemCountLimitPerResource.
My item processor returns null in some cases, so the write function of the MultiResourceItemWriter was called with empty input.
Then one empty file was created.
Should we ignore this function if the items are empty?
Thank you for your great framework.

.
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 at MultiResourceItemWriter and trace how its write function handles empty input when itemCountLimitPerResource is reached. Reproduce the processor-returning-null case, then verify that an empty input does not create an empty resource file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100