* Fix section levels
* Fix typos in code examples
* Minor updates
This commit is contained in:
Mahmoud Ben Hassine
2020-05-25 23:43:00 +02:00
parent 1eed5a30c3
commit 58bbc962d5
2 changed files with 12 additions and 12 deletions

View File

@@ -17,9 +17,9 @@ of the Batch domain language.
administration.
<<step.adoc#configureStep,Configuring a Step>> :: Step configuration, different types of steps,
controlling step flow.
<<readersAndWriters.adoc#readersAndWriters,ItemReaders and ItemWriters>> :: Item readers
and writers interfaces and how to use them.
<<processor.adoc#processor,ItemProcessor>> :: Item processor interface and how to use it.
<<readersAndWriters.adoc#readersAndWriters,Item reading and writing>> :: `ItemReader`
and `ItemWriter` interfaces and how to use them.
<<processor.adoc#itemProcessor,Item processing>> :: `ItemProcessor` interface and how to use it.
<<scalability.adoc#scalability,Scaling and Parallel Processing>> :: Multi-threaded steps,
parallel steps, remote chunking and partitioning.
<<repeat.adoc#repeat,Repeat>> :: Completion policies and exception handling of repetitive actions.

View File

@@ -2,14 +2,14 @@
:toc: left
:toclevels: 4
[[processor]]
== ItemProcessor
[[itemProcessor]]
== Item processing
ifndef::onlyonetoggle[]
include::toggle.adoc[]
endif::onlyonetoggle[]
The `ItemReader` and `ItemWriter` interfaces are both very useful for their specific
The <<readersAndWriters.adoc#readersAndWriters,ItemReader and ItemWriter interfaces>> are both very useful for their specific
tasks, but what if you want to insert business logic before writing? One option for both
reading and writing is to use the composite pattern: Create an `ItemWriter` that contains
another `ItemWriter` or an `ItemReader` that contains another `ItemReader`. The following
@@ -117,7 +117,7 @@ public Job ioSampleJob() {
@Bean
public Step step1() {
return this.stepBuilderFactory.get("step1")
.<String, String>chunk(2)
.<Foo, Bar>chunk(2)
.reader(fooReader())
.processor(fooProcessor())
.writer(barWriter())
@@ -129,7 +129,7 @@ A difference between `ItemProcessor` and `ItemReader` or `ItemWriter` is that an
is optional for a `Step`.
[[chainingItemProcessors]]
==== Chaining ItemProcessors
=== Chaining ItemProcessors
Performing a single transformation is useful in many scenarios, but what if you want to
'chain' together multiple `ItemProcessor` implementations? This can be accomplished using
@@ -223,7 +223,7 @@ public Job ioSampleJob() {
@Bean
public Step step1() {
return this.stepBuilderFactory.get("step1")
.<String, String>chunk(2)
.<Foo, Foobar>chunk(2)
.reader(fooReader())
.processor(compositeProcessor())
.writer(foobarWriter())
@@ -245,7 +245,7 @@ public CompositeItemProcessor compositeProcessor() {
----
[[filteringRecords]]
==== Filtering Records
=== Filtering Records
One typical use for an item processor is to filter out records before they are passed to
the `ItemWriter`. Filtering is an action distinct from skipping. Skipping indicates that
@@ -265,7 +265,7 @@ the `ItemWriter`. As usual, an exception thrown from the `ItemProcessor` results
skip.
[[validatingInput]]
==== Validating Input
=== Validating Input
In the <<readersAndWriters.adoc#readersAndWriters,ItemReaders and ItemWriters>> chapter, multiple approaches to parsing input have been
discussed. Each major implementation throws an exception if it is not 'well-formed'. The
@@ -369,7 +369,7 @@ public BeanValidatingItemProcessor<Person> beanValidatingItemProcessor() throws
----
[[faultTolerant]]
==== Fault Tolerance
=== Fault Tolerance
When a chunk is rolled back, items that have been cached during reading may be
reprocessed. If a step is configured to be fault tolerant (typically by using skip or