Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Doc] Wrong example in Registering ItemStream with a Step #5429

@djechelon

Description

@djechelon

This is a documentation-only issue.

After reading Registering ItemStream with a Step at https://docs.spring.io/spring-batch/reference/step/chunk-oriented-processing/registering-item-streams.html, I see that the provided example is IMO wrong.

The code example shows that implementor must register fileWriterItem1() and fileWriterItem2() as .stream because, quoted

In the preceding example, the CompositeItemWriter is not an ItemStream, but both of its delegates are

This looks inherently wrong with the actual implementation of CompositeItemWriter that indeed extends ItemStreamWriter<T>.

See also #2043, #1419 (actually a duplicate of this, cannot be reopened), #2740.

The article is indeed correct in highlighting that one must register a listener with .stream() explicitly when the handler is not detected as an ItemStream itself, but I couldn't find a viable example to contribute.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions