Updated readmes to improve copy pastability

Also added instructions for native compilation for those apps that it is useful

Added documentation for native compilation when using Single Step Batch Processing

Updated documentaiton for native compilation for single app processing
This commit is contained in:
Glenn Renfro
2022-10-05 14:37:12 -04:00
parent 704667d542
commit b7b7de5337
13 changed files with 144 additions and 49 deletions

View File

@@ -365,6 +365,32 @@ itself by setting the following properties:
See the https://docs.spring.io/spring-batch/docs/4.3.x/api/org/springframework/batch/item/kafka/KafkaItemReader.html[`KafkaItemReader` documentation].
[[nativeCompilation]]
=== Native Compilation
The advantage of Single Step Batch Processing is that it lets you dynamically select which reader and writer beans to use at runtime when you use the JVM.
However, when you use native compilation, you must determine the reader and writer at build time instead of runtime.
The following example does so:
[source,xml]
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>process-aot</id>
<goals>
<goal>process-aot</goal>
</goals>
<configuration>
<jvmArguments>
-Dspring.batch.job.flatfileitemreader.name=fooReader
-Dspring.batch.job.flatfileitemwriter.name=fooWriter
</jvmArguments>
</configuration>
</execution>
</executions>
</plugin>
[[item-processors]]
== ItemProcessor Configuration

View File

@@ -373,9 +373,8 @@ NOTE: The exit code for the application will be 1 if the task fails because this
is enabled and another task is running with the same task name.
==== Single Instance Usage for Spring AOT And Native Compilation
To utilize Spring Cloud Task's single instance feature when creating a natively compiled app, the feature needs to enabled at build time.
This is done by adding the `process-aot` execution and setting the `spring.cloud.task.single-step-instance-enabled=true` as a JVM argument as shown below:
To use Spring Cloud Task's single-instance feature when creating a natively compiled app, you need to enable the feature at build time.
To do so, add the process-aot execution and set `spring.cloud.task.single-step-instance-enabled=true` as a JVM argument, as follows:
[source,xml]
<plugin>
<groupId>org.springframework.boot</groupId>