-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed as not planned
Closed as not planned
Copy link
Labels
has: minimal-exampleBug reports that provide a minimal complete reproducible exampleBug reports that provide a minimal complete reproducible exampletype: bug
Description
Bug description
Spring Batch offers the possibility to configure a chunk-oriented step as multi-threaded by configuring a TaskExecutor
in the Step configuration.
When configured with multi-thread, the produced JSON is sometimes not correctly formatted.
Detected with Spring Batch 5.1.2 and Spring Framework 6.1.13.
Wrong result
Sometime the produced JSON is misformatted :
[
,
{"code":10002,"ref":"B2C3D4E5F6G7","type":11,"nature":6,"etat":2,"ref2":"B2C3D4E5F6G7"} {"code":10001,"ref":"A1B2C3D4E5F6","type":10,"nature":5,"etat":1,"ref2":"A1B2C3D4E5F6"},
{"code":10003,"ref":"C3D4E5F6G7H8","type":12,"nature":7,"etat":3,"ref2":"C3D4E5F6G7H8"},
{"code":10004,"ref":"D4E5F6G7H8I9","type":13,"nature":8,"etat":4,"ref2":"D4E5F6G7H8I9"}
]
Expected result
[
{"code":10001,"ref":"A1B2C3D4E5F6","type":10,"nature":5,"etat":1,"ref2":"A1B2C3D4E5F6"},
{"code":10002,"ref":"B2C3D4E5F6G7","type":11,"nature":6,"etat":2,"ref2":"B2C3D4E5F6G7"},
{"code":10003,"ref":"C3D4E5F6G7H8","type":12,"nature":7,"etat":3,"ref2":"C3D4E5F6G7H8"},
{"code":10004,"ref":"D4E5F6G7H8I9","type":13,"nature":8,"etat":4,"ref2":"D4E5F6G7H8I9"}
]
When the file is not well formatted, the error is always the same :
- a single comma appears at the first line
- the second line contains 2 JSON records without separator
Minimal Complete Reproducible example
https://github.com/glelarge/spring-batch-json-multithread
git clone https://github.com/glelarge/spring-batch-json-multithread
cd spring-batch-json-multithread
mvn package
./run.sh
If the issue is related to the configuration, would it be possible to update the repo to fix the configuration ?
Metadata
Metadata
Assignees
Labels
has: minimal-exampleBug reports that provide a minimal complete reproducible exampleBug reports that provide a minimal complete reproducible exampletype: bug