spring-projects / spring-projects/spring-batch

Explain the differences about the possibles batch:listeners declaration locations [BATCH-2628]

Open
#977 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: core in: documentation status: waiting-for-triage type: enhancement
Dominant language
Java
Stars
3k
Forks
2.5k
Avg merge
6d 53m
Merged PRs (30d)
3

Description

Manuel Jordan opened BATCH-2628 and commented

Currently either of the following works fine (Read A and B comments):

<batch:chunk reader="personFileItemReader" ...>
   <batch:retryable-exception-classes>
    ...
   </batch:retryable-exception-classes>
   <batch:retry-listeners>
      <batch:listener ref="..."/>
      ...
   </batch:retry-listeners>
   <batch:skippable-exception-classes>
	<batch:include class="..."/>
   </batch:skippable-exception-classes>
   <!-- A (within chunk)-->
   <batch:listeners>
	<batch:listener ref="..."/>
   </batch:listeners>
</batch:chunk>

and

<batch:chunk reader="personFileItemReader" ...>
   <batch:retryable-exception-classes>
    ...
   </batch:retryable-exception-classes>
   <batch:retry-listeners>
      <batch:listener ref="..."/>
      ...
   </batch:retry-listeners>
   <batch:skippable-exception-classes>
	<batch:include class="..."/>
   </batch:skippable-exception-classes>
</batch:chunk>
<!-- B (outer chunk)-->
<batch:listeners>
	<batch:listener ref="..."/>
</batch:listeners>

Even more, is possible declare batch:listeners outer of batch:tasklet (not tested for execution)

Not sure if it is a bug, but is not clear through the current Spring Batch Reference Documentation if exists a difference if the batch:listeners component is declared in either of these possible and valid locations


Affects: 3.0.6, 3.0.7

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 the Spring Batch Reference Documentation and compare the documented batch:listeners locations shown in the issue: inside chunk, outside chunk, and outside tasklet. Check whether each location has different behavior or scope. Done means the documentation clearly explains the valid locations and their differences, or states that they are equivalent.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.