Introduce SynchronizedItemStreamWriter

Issue #842
This commit is contained in:
Dimitrios Liapis
2018-10-30 02:32:15 +01:00
committed by Mahmoud Ben Hassine
parent 2f8aff2f38
commit 117b7d5f2d
6 changed files with 290 additions and 0 deletions

View File

@@ -3000,6 +3000,7 @@ Spring Batch includes the following decorators:
* <<synchronizedItemStreamReader>>
* <<singleItemPeekableItemReader>>
* <<synchronizedItemStreamWriter>>
* <<multiResourceItemWriter>>
* <<classifierCompositeItemWriter>>
* <<classifierCompositeItemProcessor>>
@@ -3023,6 +3024,13 @@ NOTE: SingleItemPeekableItemReader's peek method is not thread-safe, because it
be possible to honor the peek in multiple threads. Only one of the threads that peeked
would get that item in the next call to read.
[[synchronizedItemStreamWriter]]
===== `SynchronizedItemStreamWriter`
When using an `ItemWriter` that is not thread safe, Spring Batch offers the
`SynchronizedItemStreamWriter` decorator, which can be used to make the `ItemWriter`
thread safe. Spring Batch provides a `SynchronizedItemStreamWriterBuilder` to construct
an instance of the `SynchronizedItemStreamWriter`.
[[multiResourceItemWriter]]
===== `MultiResourceItemWriter`
The `MultiResourceItemWriter` wraps a `ResourceAwareItemWriterItemStream` and creates a new