Skip to content

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

Open
@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions