spring-projects / spring-projects/spring-batch

MultiResourceItemWriter creates an empty file if the number of item to write as itemCountLimitPerResource

Open
#4,013 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-reporter type: bug
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.

Screen Shot 2021-10-14 at 6 38 27 PM
.

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.